/* ============================================================
   TASKORA — Organize. Focus. Bloom.
   Charte graphique : minimal · moderne · féminin · focus
   ============================================================ */

/* ---------- Palette & tokens ---------- */
:root {
  /* Couleurs de marque */
  --terracotta:    #C28374; /* Almond Terracotta — couleur signature */
  --terracotta-dk: #A9685A;
  --nude:          #D9A79E; /* Petunia Nude Pink */
  --blush:         #EBC9BC; /* Apricot Blush */
  --blush-soft:    #F3DED5;
  --offwhite:      #F7F1EB; /* Whitfly Off-White */
  --cream:         #FBF7F2;
  --soft-grey:     #CFC8C2; /* Adobe Soft Grey */
  --warm-grey:     #9E938C; /* Arabel Warm Grey */
  --ink:           #4A413D; /* texte principal, chaud */
  --ink-soft:      #6E635D;

  /* Sémantique */
  --bg:            var(--cream);
  --surface:       #FFFFFF;
  --surface-2:     var(--offwhite);
  --border:        #ECE3DB;
  --border-strong: #E0D4C9;
  --text:          var(--ink);
  --text-muted:    var(--ink-soft);
  --accent:        var(--terracotta);
  --accent-hover:  var(--terracotta-dk);
  --danger:        #C75B5B;

  /* Typo */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Rayons & ombres */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(74, 65, 61, .05), 0 1px 1px rgba(74, 65, 61, .03);
  --shadow:    0 2px 6px rgba(74, 65, 61, .04), 0 10px 28px rgba(74, 65, 61, .08);
  --shadow-lg: 0 4px 12px rgba(74, 65, 61, .06), 0 24px 60px rgba(74, 65, 61, .16);
  --ring:      0 0 0 3px var(--blush-soft);

  /* Mouvement */
  --ease: cubic-bezier(.2, .7, .2, 1);

  --sidebar-w: 280px;
  --rail-w: 72px;
  --app-h: 100vh;          /* hauteur utile de l'appli (moins l'en-tête mobile) */

  /* Tons utilitaires (redéfinis en mode sombre) */
  --solid:       #4A413D;  /* pastilles actives, toasts */
  --mix-base:    #FFFFFF;  /* base des teintes color-mix */
  --mix-ink:     #3a322f;
  --danger-soft: #FBE9E9;
  --danger-line: #F3D2D2;
  --warn-soft:   #FBEFD9;
  --warn-line:   #F0DDB5;
  --ok-soft:     #E6F0E6;
  --info-soft:   #EAF1F7;
  --info-line:   #D3E1EE;
  --cal-we:      #FDFAF7;
  --cal-sel:     #FBF0EB;
  --cal-today:   #FFFBF8;
  --warn-ink:    #9a6b1f;
  --ok-ink:      #4D7A55;
  color-scheme: light;
}

/* ---------- Mode sombre ---------- */
:root[data-theme="dark"] {
  --terracotta:    #CF8F7F;
  --terracotta-dk: #E3A999;
  --nude:          #B27F72;
  --blush:         #5A443D;
  --blush-soft:    #3A2E2A;
  --offwhite:      #2A2421;
  --cream:         #1D1917;
  --soft-grey:     #4E4541;
  --warm-grey:     #9C9089;
  --ink:           #F2E8E1;
  --ink-soft:      #C3B6AE;

  --surface:       #25201E;
  --surface-2:     #2F2825;
  --border:        #3A322F;
  --border-strong: #4A403C;
  --danger:        #E4847B;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --shadow:    0 2px 6px rgba(0,0,0,.2), 0 10px 28px rgba(0,0,0,.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.3), 0 24px 60px rgba(0,0,0,.45);

  --solid:       #5E514B;
  --mix-base:    #25201E;
  --mix-ink:     #F2E8E1;
  --danger-soft: rgba(228,132,123,.16);
  --danger-line: rgba(228,132,123,.35);
  --warn-soft:   rgba(216,169,59,.16);
  --warn-line:   rgba(216,169,59,.35);
  --ok-soft:     rgba(143,185,150,.16);
  --info-soft:   rgba(120,160,205,.14);
  --info-line:   rgba(120,160,205,.32);
  --cal-we:      #221D1B;
  --cal-sel:     #34292560;
  --cal-today:   #2A2220;
  --warn-ink:    #E2B45A;
  --ok-ink:      #9BCBA3;
  color-scheme: dark;
}
:root[data-theme="dark"] img.logo-ink, :root[data-theme="dark"] .auth img[src*="wordmark"] { filter: brightness(1.6); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; color: var(--text); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--blush); color: var(--ink); }

/* Focus clavier visible et doux (souris : aucun contour) */
:focus-visible { outline: 2px solid var(--nude); outline-offset: 2px; border-radius: 6px; }
.input:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .ql-editor:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--soft-grey) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--soft-grey); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--warm-grey); background-clip: content-box; }

/* ---------- Utilitaires ---------- */
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--blush); border-top-color: var(--terracotta);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 14px; font-weight: 700; letter-spacing: .2px;
  transition: transform .15s var(--ease), background .15s ease, box-shadow .15s ease, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--terracotta); color: #fff; box-shadow: 0 1px 2px rgba(169,104,90,.25), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(169,104,90,.28); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--soft-grey); }
.btn-subtle { background: var(--surface-2); color: var(--text); }
.btn-subtle:hover { background: var(--blush-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); box-shadow: 0 4px 12px color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-icon {
  width: 30px; height: 30px; padding: 0; border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Champs ---------- */
.field { margin-bottom: 16px; text-align: left; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 11px 14px; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--warm-grey); }
.input:hover { border-color: var(--soft-grey); }
.input:focus { outline: none; border-color: var(--nude); box-shadow: var(--ring); }

/* ============================================================
   AUTH (landing + connexion / inscription)
   ============================================================ */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.auth__hero {
  position: relative; overflow: hidden; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--blush-soft) 0%, var(--offwhite) 55%, var(--surface) 100%);
}
.auth__hero::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 460px; height: 460px;
  background: url("../img/logo-mark.png") center/contain no-repeat; opacity: .5; pointer-events: none;
}
.auth__brand { display: flex; align-items: center; gap: 12px; }
.auth__brand img { height: 26px; width: auto; }
.auth__tagline { position: relative; z-index: 1; max-width: 420px; }
.auth__tagline .eyebrow { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--terracotta); font-weight: 700; }
.auth__tagline h1 { font-size: clamp(34px, 4vw, 52px); margin: 14px 0 16px; }
.auth__tagline p { font-size: 17px; color: var(--ink-soft); }
.auth__features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.auth__features li { display: flex; align-items: center; gap: 12px; list-style: none; color: var(--ink-soft); font-weight: 600; }
.auth__features ul { margin: 0; padding: 0; display: grid; gap: 12px; }
.auth__features .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--terracotta); box-shadow: var(--shadow-sm); flex: none; }

.auth__panel { display: grid; place-items: center; padding: 40px; }
.auth__card { width: 100%; max-width: 380px; }
.auth__card h2 { font-size: 28px; margin-bottom: 6px; }
.auth__card .sub { color: var(--text-muted); margin: 0 0 26px; }
.auth__logo-mobile { display: none; }
.auth__switch { margin-top: 22px; text-align: center; color: var(--text-muted); font-size: 14px; }
.auth__switch button { background: none; border: none; color: var(--terracotta); font-weight: 700; padding: 0; }
.auth__switch button:hover { text-decoration: underline; }
.auth__error {
  background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px;
}
.auth__notice {
  background: var(--blush-soft); color: var(--terracotta-dk); border: 1px solid var(--blush);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px;
}

@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth__hero { display: none; }
  .auth__logo-mobile { display: flex; justify-content: center; margin-bottom: 24px; }
  .auth__logo-mobile img { height: 24px; }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; height: var(--app-h); overflow: hidden; }
.workarea { min-width: 0; overflow: hidden; }
.workarea--notes { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: var(--app-h); }

/* ---------- Rail des espaces (workspace) ---------- */
.rail {
  background: linear-gradient(180deg, #51473F 0%, #4A413D 40%, #3F3733 100%); display: flex; flex-direction: column; align-items: center;
  gap: 14px; padding: 14px 0; height: var(--app-h);
}
.rail__logo { width: 44px; height: 44px; display: grid; place-items: center; flex: none; pointer-events: none; user-select: none; }
.rail__logo img { width: 100%; height: 100%; object-fit: contain; filter: brightness(1.45); }
.rail__mods { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.rail__sep { display: block; width: 22px; height: 1px; margin: 2px auto; background: rgba(255,255,255,.14); flex: none; }
.rail__mod {
  width: 44px; height: 44px; border-radius: 13px; border: none; background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82); display: grid; place-items: center; font-size: 20px; transition: background .15s, color .15s, transform .15s var(--ease);
}
.rail__mod:hover { background: rgba(255,255,255,.16); color: #fff; }
.rail__mod:active { transform: scale(.94); }
.rail__mod.active { background: var(--terracotta); color: #fff; box-shadow: 0 6px 16px rgba(194,131,116,.45); }
.rail__mod.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 4px; height: 20px; transform: translateY(-50%);
  background: var(--blush); border-radius: 0 4px 4px 0;
}
.rail__mod.soon { color: rgba(255,255,255,.55); }
.rail__mod.soon svg { width: 18px; height: 18px; }
.rail__spacer { flex: 1; }
.rail__avatar { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); cursor: pointer; transition: border-color .15s; }
.rail__avatar:hover { border-color: var(--blush); }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--offwhite); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: var(--app-h); min-width: 0;
}
.sidebar__head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
.sidebar__head img { height: 26px; width: auto; }
.sidebar__title { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text); }
.sidebar__actions { padding: 0 12px 10px; display: flex; gap: 8px; }
/* Boutons de la barre latérale : à plat, fond blanc et fine bordure (sans relief) */
.sidebar__actions .btn { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.sidebar__actions .btn svg { color: var(--terracotta); }
.sidebar__actions .btn:hover { background: var(--blush-soft); border-color: var(--nude); box-shadow: none; }
.sidebar__actions .btn:active { transform: none; }
.sidebar__tools { display: flex; gap: 6px; padding: 0 14px 8px; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none;
  color: var(--text-muted); font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 6px;
  border-radius: 6px; transition: background .12s, color .12s;
}
.linkbtn:hover { background: var(--blush-soft); color: var(--text); }
.linkbtn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.linkbtn svg { width: 14px; height: 14px; }
.sidebar__search {
  margin: 0 12px 8px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px;
}
.sidebar__search input { border: none; background: none; outline: none; width: 100%; font-family: inherit; font-size: 14px; color: var(--text); }
.sidebar__search svg { color: var(--warm-grey); flex: none; }

.tree { flex: 1; overflow-y: auto; padding: 6px 8px 20px; }
.tree.drop-root { background: var(--blush-soft); border-radius: var(--radius); outline: 2px dashed var(--nude); outline-offset: -4px; }
.tree__section-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--warm-grey); font-weight: 700; padding: 12px 10px 6px; }

.node { user-select: none; }
.node__row {
  display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-soft); transition: background .12s, color .12s; position: relative;
}
.node__row:hover { background: var(--blush-soft); color: var(--text); }
.node__row.active { background: var(--surface); color: var(--terracotta-dk); font-weight: 700; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.node__caret { width: 18px; height: 18px; display: grid; place-items: center; flex: none; color: var(--warm-grey); transition: transform .15s; }
.node__caret.open { transform: rotate(90deg); }
.node__caret.leaf { visibility: hidden; }
.node__icon { width: 18px; text-align: center; flex: none; }
.node__name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.node__menu { opacity: 0; flex: none; }
.node__row:hover .node__menu { opacity: 1; }
.node__pin { flex: none; color: var(--nude); display: inline-flex; }
.node__pin svg { width: 13px; height: 13px; }
.node__rename {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 1px 6px; margin: -2px 0;
  border: 1px solid var(--nude); border-radius: 6px; outline: none; background: var(--surface); color: var(--text);
  box-shadow: 0 0 0 3px var(--blush-soft);
}

/* Glisser-déposer : états visuels */
.node__row.dragging { opacity: .4; }
.node__row.drop-into { background: var(--terracotta); color: #fff; box-shadow: 0 0 0 2px var(--terracotta); }
.node__row.drop-into .node__caret, .node__row.drop-into .node__icon { color: #fff; }
.node__row.drop-before::before,
.node__row.drop-after::after {
  content: ""; position: absolute; left: 8px; right: 8px; height: 2px;
  background: var(--terracotta); border-radius: 2px;
}
.node__row.drop-before::before { top: -1px; }
.node__row.drop-after::after { bottom: -1px; }
.node__children { margin-left: 14px; border-left: 1px solid var(--border-strong); padding-left: 4px; }
.search-snip { font-size: 11.5px; color: var(--text-muted); padding: 0 10px 5px 30px; margin-top: -2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-stats { color: var(--warm-grey); }

.sidebar__foot { border-top: 1px solid var(--border); padding: 10px 12px; }
.userchip { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s; }
.userchip:hover { background: var(--blush-soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--terracotta); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.userchip__name { flex: 1; min-width: 0; }
.userchip__name b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userchip__name span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* ---------- Main / editor ---------- */
.main { overflow-y: auto; height: var(--app-h); background: var(--bg); position: relative; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 12px 28px; background: color-mix(in srgb, var(--cream) 85%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; }
.breadcrumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb .sep { color: var(--soft-grey); }
.save-state { font-size: 12.5px; color: var(--warm-grey); display: flex; align-items: center; gap: 6px; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--soft-grey); }
.save-state.saving .dot { background: var(--nude); }
.save-state.saved .dot { background: #8FB996; }
.save-state.error { color: var(--danger); }
.save-state.error .dot { background: var(--danger); }

/* Bouton favori (barre du haut) */
#pin-btn.pinned, #snip-pin.pinned { color: var(--terracotta); }
#pin-btn:not(.pinned) { color: var(--soft-grey); }

/* Couverture de page */
.page-cover { height: 0; transition: height .2s; }
.page-cover.has-cover {
  height: 200px; position: relative; border-bottom: 1px solid var(--border);
}
.page-cover__tools { position: absolute; right: 16px; bottom: 14px; display: flex; gap: 8px; opacity: 0; transition: opacity .15s; }
.page-cover.has-cover:hover .page-cover__tools { opacity: 1; }
.page-cover__tools .btn { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-sm); }

.page { max-width: 760px; margin: 0 auto; padding: 38px 28px 140px; position: relative; }
.page-cover.has-cover + .page { padding-top: 0; }
.page-cover.has-cover + .page .page__head { margin-top: -34px; }

.page-actions { height: 26px; margin-bottom: 4px; }
.ghostlink {
  display: inline-flex; align-items: center; gap: 7px; background: none; border: none; cursor: pointer;
  color: var(--warm-grey); font-family: inherit; font-size: 13.5px; font-weight: 700; padding: 4px 8px;
  border-radius: 6px; opacity: 0; transition: opacity .15s, background .12s, color .12s;
}
.page:hover .ghostlink { opacity: 1; }
.ghostlink:hover { background: var(--blush-soft); color: var(--text); }

.page__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.page__emoji {
  flex: none; font-size: 40px; line-height: 1; cursor: pointer; background: none; border: none;
  padding: 6px; border-radius: 12px; color: var(--terracotta); transition: background .12s, transform .1s;
}
.page__emoji:hover { background: var(--surface-2); transform: scale(1.06); }
.page__emoji svg { display: block; }
.page__emoji .tk-emoji { line-height: 1; }
.page__title {
  flex: 1; min-width: 0; border: none; background: none; outline: none; resize: none; overflow: hidden;
  font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--text);
  line-height: 1.2; margin: 0; padding: 4px 0 0;
}
.page__title::placeholder { color: var(--soft-grey); }
.page__meta { color: var(--warm-grey); font-size: 12.5px; margin-bottom: 22px; }

/* Sélecteur de couverture */
.cover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 4px; }
.cover-swatch { height: 56px; border: none; border-radius: var(--radius-sm); cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .12s; }
.cover-swatch:hover { transform: scale(1.04); }

/* Corbeille */
.trash-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; margin-top: 8px; }
.trash-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.trash-item__icon { font-size: 18px; flex: none; }
.trash-item__name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   ÉDITEUR QUILL — habillage Taskora
   ============================================================ */
/* Barre d'outils : collante, arrondie, groupes séparés */
.ql-toolbar.ql-snow {
  position: sticky; top: 60px; z-index: 4; /* se cale sous la barre du haut */
  border: 1px solid var(--border) !important; border-radius: 14px !important;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  padding: 5px 3px !important; margin: 4px 0 28px;
  box-shadow: 0 1px 2px rgba(74,65,61,.04), 0 6px 20px rgba(74,65,61,.06);
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0;
}
.ql-toolbar.ql-snow .ql-formats { display: inline-flex; align-items: center; gap: 1px; margin: 0 !important; padding: 0 4px; position: relative; }
.ql-toolbar.ql-snow .ql-formats + .ql-formats::before {
  content: ""; position: absolute; left: 0; top: 22%; height: 56%; width: 1px; background: var(--border);
}
/* Options avancées repliées */
.ql-toolbar.ql-snow .ql-formats.tk-adv { display: none; }
.ql-toolbar.ql-snow.is-expanded .ql-formats.tk-adv { display: inline-flex; }
.ql-toolbar.ql-snow .tk-break { display: none; flex-basis: 100%; height: 0; }
.ql-toolbar.ql-snow.is-expanded .tk-break { display: block; border-top: 1px dashed var(--border); margin: 3px 6px; }
.ql-toolbar.ql-snow .tk-more { margin-left: auto !important; }
.ql-toolbar.ql-snow .tk-more { padding: 0 2px; }
.ql-toolbar.ql-snow .tk-more::before { display: none; }
.tk-more__btn { color: var(--ink-soft); display: grid !important; place-items: center; }
.ql-snow.ql-toolbar button.tk-more__btn.ql-active { background: var(--blush-soft) !important; color: var(--terracotta-dk); }
.ql-container.ql-snow { border: none !important; font-family: var(--font-body); }
.ql-editor {
  padding: 0; min-height: 320px; font-size: 16px; line-height: 1.75; color: var(--text);
}
.ql-editor.ql-blank::before { color: var(--soft-grey); font-style: normal; left: 0; right: 0; }
.ql-editor h1, .ql-editor h2, .ql-editor h3 { font-family: var(--font-display); color: var(--text); letter-spacing: -.01em; line-height: 1.25; }
.ql-editor h1 { font-size: 30px; margin: 30px 0 10px; }
.ql-editor h2 { font-size: 24px; margin: 26px 0 8px; }
.ql-editor h3 { font-size: 19px; margin: 20px 0 6px; color: var(--ink-soft); }
.ql-editor > :first-child { margin-top: 0; }
.ql-editor p { margin: 0 0 6px; }

/* Listes : puces et numéros terracotta */
.ql-editor li { padding-left: 1.6em; margin: 3px 0; }
.ql-editor li[data-list="bullet"] > .ql-ui::before { color: var(--terracotta); font-size: 1.1em; }
.ql-editor li[data-list="ordered"] > .ql-ui::before { color: var(--terracotta-dk); font-weight: 700; font-size: .92em; }
/* Cases à cocher arrondies */
.ql-editor li[data-list="checked"] > .ql-ui, .ql-editor li[data-list="unchecked"] > .ql-ui { cursor: pointer; }
.ql-editor li[data-list="checked"] > .ql-ui::before,
.ql-editor li[data-list="unchecked"] > .ql-ui::before {
  content: "" !important; display: inline-block; width: 16px; height: 16px; box-sizing: border-box;
  border: 1.5px solid var(--soft-grey); border-radius: 5px; background: var(--surface); vertical-align: -3px;
  transition: background .12s, border-color .12s;
}
.ql-editor li[data-list="unchecked"]:hover > .ql-ui::before { border-color: var(--nude); }
.ql-editor li[data-list="checked"] > .ql-ui::before {
  border-color: var(--terracotta);
  background: var(--terracotta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat;
}
.ql-editor li[data-list="checked"] { color: var(--warm-grey); text-decoration: line-through; text-decoration-color: var(--soft-grey); }

/* Citation : élégante, sans gros aplat */
.ql-editor blockquote {
  border-left: 2px solid var(--nude) !important; border-radius: 0; background: none;
  margin: 14px 0 !important; padding: 2px 0 2px 18px !important;
  font-family: var(--font-display); font-style: italic; font-size: 18px; line-height: 1.6; color: var(--terracotta-dk);
}
.ql-editor pre.ql-syntax, .ql-editor .ql-code-block-container { background: #2f2a28; color: #f3ece6; border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; }
.ql-editor code { background: var(--blush-soft); color: var(--terracotta-dk); border-radius: 5px; padding: 1px 5px; font-size: .9em; }
.ql-editor a { color: var(--terracotta-dk); text-decoration: underline; text-decoration-color: var(--nude); text-underline-offset: 3px; transition: text-decoration-color .12s; }
.ql-editor a:hover { text-decoration-color: var(--terracotta-dk); }
.ql-editor img { border-radius: var(--radius); box-shadow: var(--shadow-sm); margin: 8px 0; max-width: 100%; height: auto; cursor: pointer; }
.ql-editor img[data-align="left"]   { float: left;  margin: 4px 18px 10px 0; }
.ql-editor img[data-align="right"]  { float: right; margin: 4px 0 10px 18px; }
.ql-editor img[data-align="center"] { display: block; margin: 12px auto; float: none; }

/* Outil de redimensionnement / alignement d'image */
.img-tools { position: fixed; z-index: 70; display: none; pointer-events: none; box-shadow: 0 0 0 2px var(--terracotta); border-radius: 6px; }
.img-tools__handle { position: absolute; width: 14px; height: 14px; background: var(--surface); border: 2px solid var(--terracotta); border-radius: 50%; pointer-events: auto; box-shadow: var(--shadow-sm); }
.img-tools__handle.br { right: -8px; bottom: -8px; cursor: nwse-resize; }
.img-tools__bar { position: absolute; top: -42px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; background: var(--solid); padding: 4px; border-radius: 10px; pointer-events: auto; box-shadow: var(--shadow); }
.img-tools__bar button { width: 30px; height: 28px; border: none; background: transparent; color: #fff; border-radius: 6px; font-size: 14px; cursor: pointer; transition: background .12s; }
.img-tools__bar button:hover { background: rgba(255,255,255,.22); }

/* Boutons de la barre : discrets, pastille rose au survol / actif */
.ql-snow.ql-toolbar button {
  width: 29px !important; height: 30px !important; padding: 6px 5px !important; border-radius: 8px;
  transition: background .12s ease, transform .08s ease;
}
.ql-snow.ql-toolbar button:active { transform: scale(.92); }
.ql-snow .ql-stroke { stroke: var(--ink-soft); }
.ql-snow .ql-fill { fill: var(--ink-soft); }
.ql-snow .ql-picker { color: var(--ink-soft); }
.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button:focus-visible { background: var(--surface-2); }
.ql-snow.ql-toolbar button:hover .ql-stroke { stroke: var(--ink); }
.ql-snow.ql-toolbar button:hover .ql-fill { fill: var(--ink); }
/* État actif : pastille rose poudré, icône terracotta */
.ql-snow.ql-toolbar button.ql-active { background: var(--blush-soft) !important; }
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--terracotta-dk) !important; }
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--terracotta-dk) !important; }
.ql-snow .ql-picker-label.ql-active { color: var(--terracotta-dk) !important; }
.ql-snow .ql-picker-label.ql-active .ql-stroke { stroke: var(--terracotta-dk) !important; }
.ql-snow .ql-picker-item.ql-selected { color: var(--terracotta) !important; }

/* Sélecteurs texte (titre, police, taille…) : sans cadre, fond au survol */
.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label {
  border: none !important; border-radius: 8px; background: transparent;
  padding: 0 20px 0 9px !important; height: 30px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 700;
  transition: background .12s;
}
.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label:hover { background: var(--surface-2); color: var(--ink); }
.ql-snow .ql-picker.ql-expanded .ql-picker-label { background: var(--blush-soft) !important; color: var(--terracotta-dk) !important; }
.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke { stroke: var(--terracotta-dk); }
.ql-snow .ql-picker-label svg { right: 3px; width: 14px !important; }
.ql-snow .ql-icon-picker .ql-picker-label, .ql-snow .ql-color-picker .ql-picker-label { border: none !important; border-radius: 8px; padding: 3px 4px !important; }
.ql-snow .ql-icon-picker .ql-picker-label:hover, .ql-snow .ql-color-picker .ql-picker-label:hover { background: var(--surface-2); }
.ql-snow .ql-picker.ql-header { width: 80px; }
.ql-snow .ql-picker.ql-font { width: 78px; }
.ql-snow .ql-picker.ql-size { width: 60px; }
.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label::before { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 30px; }
.ql-snow .ql-picker-options { border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; border-color: var(--border) !important; padding: 6px !important; }
.ql-snow .ql-picker-item { border-radius: 6px; padding: 5px 8px !important; }
.ql-snow .ql-picker-item:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
/* Pastilles de couleur plus jolies */
.ql-snow .ql-color .ql-picker-item, .ql-snow .ql-background .ql-picker-item { border-radius: 50% !important; border: 1px solid rgba(0,0,0,.06) !important; }

/* Étiquettes lisibles des polices et des tailles dans le menu */
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="sans"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="sans"]::before { content: "Sans"; font-family: var(--font-body); }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="serif"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="serif"]::before { content: "Serif"; font-family: Georgia, serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="playfair"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="playfair"]::before { content: "Playfair"; font-family: var(--font-display); }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="poppins"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="poppins"]::before { content: "Poppins"; font-family: "Poppins", sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="quicksand"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="quicksand"]::before { content: "Quicksand"; font-family: "Quicksand", sans-serif; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="cursive"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="cursive"]::before { content: "Script"; font-family: "Dancing Script", cursive; font-size: 17px; }
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="mono"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="mono"]::before { content: "Mono"; font-family: monospace; }
.ql-snow .ql-picker.ql-font .ql-picker-label:not([data-value])::before,
.ql-snow .ql-picker.ql-font .ql-picker-item:not([data-value])::before { content: "Police"; }

/* Application réelle des polices dans le contenu */
.ql-font-sans { font-family: var(--font-body); }
.ql-font-serif { font-family: Georgia, "Times New Roman", serif; }
.ql-font-playfair { font-family: var(--font-display); }
.ql-font-poppins { font-family: "Poppins", sans-serif; }
.ql-font-quicksand { font-family: "Quicksand", sans-serif; }
.ql-font-cursive { font-family: "Dancing Script", cursive; font-size: 1.25em; }
.ql-font-mono { font-family: "SFMono-Regular", Consolas, monospace; }

/* Tailles dans le menu */
.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.ql-snow .ql-picker.ql-size .ql-picker-item::before { content: attr(data-value); }
.ql-snow .ql-picker.ql-size .ql-picker-label:not([data-value])::before { content: "Taille"; }

/* Titres (en français) */
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Texte"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { content: "Titre 1"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Titre 2"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Titre 3"; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"] { font-family: var(--font-display); font-size: 20px; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"] { font-family: var(--font-display); font-size: 17px; }
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"] { font-family: var(--font-display); font-size: 15px; }
/* Option « par défaut » des sélecteurs */
.ql-snow .ql-picker.ql-size .ql-picker-item:not([data-value])::before,
.ql-snow .ql-picker.ql-lineheight .ql-picker-item:not([data-value])::before,
.ql-snow .ql-picker.ql-letterspacing .ql-picker-item:not([data-value])::before,
.ql-snow .ql-picker.ql-texttransform .ql-picker-item:not([data-value])::before { content: "Par défaut"; color: var(--warm-grey); }

/* Interligne */
.ql-snow .ql-picker.ql-lineheight { width: auto; }
.ql-snow .ql-picker.ql-lineheight .ql-picker-label:not([data-value])::before { content: "Interligne"; }
.ql-snow .ql-picker.ql-lineheight [data-value="1"]::before { content: "Serré"; }
.ql-snow .ql-picker.ql-lineheight [data-value="1.35"]::before { content: "Normal"; }
.ql-snow .ql-picker.ql-lineheight [data-value="1.75"]::before { content: "Aéré"; }
.ql-snow .ql-picker.ql-lineheight [data-value="2.2"]::before { content: "Large"; }

/* Espacement des lettres */
.ql-snow .ql-picker.ql-letterspacing .ql-picker-label:not([data-value])::before { content: "Espacement"; }
.ql-snow .ql-picker.ql-letterspacing [data-value="normal"]::before { content: "Normal"; }
.ql-snow .ql-picker.ql-letterspacing [data-value="0.5px"]::before { content: "Petit"; }
.ql-snow .ql-picker.ql-letterspacing [data-value="1px"]::before { content: "Moyen"; }
.ql-snow .ql-picker.ql-letterspacing [data-value="2px"]::before { content: "Large"; }
.ql-snow .ql-picker.ql-letterspacing [data-value="3px"]::before { content: "Très large"; }

/* Casse */
.ql-snow .ql-picker.ql-texttransform .ql-picker-label:not([data-value])::before { content: "Casse"; }
.ql-snow .ql-picker.ql-texttransform [data-value="uppercase"]::before { content: "MAJUSCULES"; text-transform: uppercase; }
.ql-snow .ql-picker.ql-texttransform [data-value="lowercase"]::before { content: "minuscules"; }
.ql-snow .ql-picker.ql-texttransform [data-value="capitalize"]::before { content: "Initiales"; }

/* ---------- États vides ---------- */
.empty { height: 100%; display: grid; place-items: center; padding: 40px; text-align: center; }
.empty__inner { max-width: 380px; width: 100%; min-width: 0; }
.empty__inner > div { flex-wrap: wrap; }
.empty img { width: 92px; opacity: .8; margin: 0 auto 18px; }
.empty h3 { font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--text-muted); margin: 0 0 22px; }

/* ============================================================
   MODALES & MENUS
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: rgba(74,65,61,.32); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .18s ease;
}
.modal {
  background: var(--surface); width: 100%; max-width: 440px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 30px; animation: pop .22s var(--ease);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
}
@keyframes pop { from { transform: translateY(6px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal h3 { font-size: 22px; margin-bottom: 4px; }
.modal .sub { color: var(--text-muted); margin: 0 0 22px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.menu {
  position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; min-width: 180px; animation: pop .12s ease;
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text); font-weight: 600;
}
.menu button { transition: background .1s, color .1s; }
.menu button:hover { background: var(--blush-soft); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-soft); }
.menu hr { border: none; border-top: 1px solid var(--border); margin: 5px 0; }

/* Picker d'emoji simple */
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 300px; overflow-y: auto; margin-top: 12px; }
.emoji-grid__btn { aspect-ratio: 1; font-size: 22px; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; transition: background .1s, transform .08s; }
.emoji-grid__btn:hover { background: var(--blush-soft); transform: scale(1.12); }
.icon-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-height: 280px; overflow-y: auto; margin-top: 12px; }
.icon-grid__btn { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); color: var(--ink-soft); transition: background .12s, color .12s, border-color .12s; }
.icon-grid__btn:hover { background: var(--blush-soft); color: var(--terracotta); border-color: var(--nude); }

/* Icônes de contenu */
.tk-ic { display: block; }
.node__icon { display: inline-flex; align-items: center; justify-content: center; }
.node__icon svg, .node__icon .tk-emoji { display: block; }
.node__row.active .node__icon { color: var(--terracotta-dk); }
.tree__section-label { display: flex; align-items: center; gap: 6px; }
.tree__section-label svg { color: var(--nude); }
.crumb-i { display: inline-flex; align-items: center; vertical-align: -2px; margin-right: 4px; color: var(--warm-grey); }
.h3-ic { display: flex; align-items: center; gap: 8px; }
.trash-item__icon { display: inline-flex; color: var(--terracotta); }
.page__icon-row { color: var(--terracotta); }
.page__icon-row svg { display: block; }
.auth__features .dot svg { display: block; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--solid); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); }

/* ---------- Profil ---------- */
.profile-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.profile-row .avatar { width: 64px; height: 64px; font-size: 24px; }

/* ---------- Modale Profil ---------- */
.profile-modal { padding: 0 !important; overflow: hidden; max-width: 460px; }
.pe-banner {
  position: relative; height: 140px; background: linear-gradient(125deg, var(--blush) 0%, var(--nude) 60%, var(--terracotta) 100%);
  background-size: cover; background-position: center;
}
.pe-cam {
  display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--terracotta-dk); font-family: inherit; font-weight: 700; font-size: 12.5px;
  border-radius: 99px; padding: 6px 12px; box-shadow: var(--shadow-sm); transition: background .12s;
}
.pe-cam:hover { background: var(--surface); }
.pe-cam.loading { opacity: .6; pointer-events: none; }
.pe-cam svg { width: 15px; height: 15px; }
.pe-cam--banner { position: absolute; right: 12px; bottom: 12px; }
.pe-avatar-wrap { position: relative; width: max-content; margin: -44px 0 0 24px; }
.pe-avatar { width: 88px; height: 88px; font-size: 30px; border: 4px solid var(--surface); box-shadow: var(--shadow); }
.pe-cam--avatar { position: absolute; right: -4px; bottom: -2px; width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 50%; }
.pe-cam--avatar svg { width: 14px; height: 14px; }
.pe-body { padding: 14px 26px 26px; }
.pe-body .muted { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.pe-body .muted svg { width: 15px; height: 15px; }
.pe-count { text-align: right; font-size: 11.5px; color: var(--warm-grey); margin-top: 4px; }

.rail__mod-ico { font-size: 20px; line-height: 1; }

/* ============================================================
   ESPACES PLEINE LARGEUR (Rappels, Calendrier)
   ============================================================ */
.workarea--full { height: var(--app-h); }
.workarea--full .main { height: var(--app-h); }
.module { max-width: 760px; margin: 0 auto; padding: 28px 28px 120px; }

/* ---------- Rappels ---------- */
.rem-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(125deg, var(--blush-soft) 0%, var(--offwhite) 55%, var(--surface) 100%);
  border-bottom: 1px solid var(--border); padding: 30px 28px 26px;
}
.rem-hero::after {
  content: ""; position: absolute; right: -40px; top: -50px; width: 220px; height: 220px;
  background: url("../img/logo-mark.png") center/contain no-repeat; opacity: .35; pointer-events: none;
}
.rem-hero__content { position: relative; z-index: 1; max-width: 704px; margin: 0 auto; } /* aligné sur le contenu de .module */
.rem-hero:has(+ .module--wide) .rem-hero__content { max-width: 944px; }
.rem-hero__eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--terracotta); }
.rem-hero__eyebrow svg { width: 15px; height: 15px; }
.rem-hero h1 { font-size: clamp(28px, 4vw, 38px); margin: 6px 0 4px; }
.rem-hero p { color: var(--ink-soft); margin: 0; font-size: 15px; }

.rem-quick {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 7px 8px 7px 14px; box-shadow: var(--shadow-sm); margin: -28px auto 18px;
  position: relative; z-index: 2; max-width: 760px;
}
.rem-quick:focus-within { border-color: var(--nude); box-shadow: 0 0 0 3px var(--blush-soft); }
.rem-quick__plus { color: var(--terracotta); display: inline-flex; flex: none; }
.rem-quick #rq-title { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: inherit; font-size: 15px; color: var(--text); }
.rem-quick #rq-due { border: none; outline: none; background: var(--surface-2); border-radius: var(--radius-sm); padding: 7px 8px; font-family: inherit; font-size: 12.5px; color: var(--text-muted); }
.rem-quick .btn { flex: none; }

.rem-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 26px; }
.rem-chip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); position: relative; --bar: var(--soft-grey); }
.rem-chip b { font-family: var(--font-display); font-size: 24px; line-height: 1; }
.rem-chip span { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-top: 3px; }
.rem-chip.is-zero { opacity: .55; }
.rem-chip.c-overdue { --bar: var(--danger); } .rem-chip.c-overdue b { color: var(--danger); }
.rem-chip.c-today { --bar: var(--terracotta); } .rem-chip.c-today b { color: var(--terracotta); }
.rem-chip.c-upcoming { --bar: var(--nude); } .rem-chip.c-upcoming b { color: var(--terracotta-dk); }
.rem-chip.c-done { --bar: #8FB996; } .rem-chip.c-done b { color: #6f9e77; }

.rem-section { margin-bottom: 24px; }
.rem-section__label { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-grey); font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.rem-section__label span { background: var(--surface-2); color: var(--text-muted); border-radius: 99px; padding: 1px 8px; font-size: 11px; }
.rem-section__label.is-overdue { color: var(--danger); }
.rem-section__label.is-today { color: var(--terracotta); }
.rem {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .15s;
}
.rem:hover { box-shadow: var(--shadow); transform: translateX(2px); }
/* Barre d'accent colorée (remplace la bordure gauche, plus nette avec les coins arrondis) */
.rem, .goal-card { position: relative; --bar: var(--soft-grey); }
.goal-card { --bar: var(--cat, var(--nude)); }
.rem::before, .rem-chip::before, .goal-card::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px;
  background: var(--bar); border-radius: 0 3px 3px 0;
}
.rem--overdue { --bar: var(--danger); }
.rem--today { --bar: var(--terracotta); }
.rem--upcoming { --bar: var(--nude); }
.rem--done { --bar: #8FB996; }
.rem__check {
  width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong);
  background: var(--surface); color: #fff; display: grid; place-items: center; transition: background .15s, border-color .15s; cursor: pointer;
}
.rem__check:hover { border-color: var(--nude); }
.rem--done .rem__check { background: #8FB996; border-color: #8FB996; }
.rem__body { flex: 1; min-width: 0; }
.rem__title { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rem__due { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.rem__due svg { opacity: .7; }
.rem--done .rem__title { text-decoration: line-through; color: var(--warm-grey); }
.rem__edit, .rem__del { opacity: 0; flex: none; }
.rem:hover .rem__edit, .rem:hover .rem__del { opacity: 1; }
.rem__del:hover { color: var(--danger); }

.scope-select {
  border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 8px 10px; font-family: inherit; font-size: 13px; color: var(--text); outline: none; cursor: pointer; max-width: 150px;
}
.scope-select:focus { border-color: var(--nude); }
.rem__shared { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--terracotta); font-weight: 700; }
.rem__shared svg { width: 13px; height: 13px; }

.rem-empty { text-align: center; padding: 40px 20px; }
.rem-empty img { width: 76px; opacity: .8; margin: 0 auto 16px; }
.rem-empty h3 { font-size: 22px; margin-bottom: 6px; }
.rem-empty p { color: var(--text-muted); max-width: 360px; margin: 0 auto; }

@media (max-width: 620px) {
  .rem-stats { grid-template-columns: repeat(2, 1fr); }
  .rem-quick { flex-wrap: wrap; }
  .rem-quick #rq-title { flex-basis: 100%; }
}

/* ---------- Calendrier ---------- */
.seg-group { display: flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; }
.seg { border: none; background: transparent; padding: 6px 14px; border-radius: 7px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.seg.active { background: var(--surface); color: var(--terracotta-dk); box-shadow: var(--shadow-sm); }

/* Modale événement */
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.ev-allday { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 14px; cursor: pointer; }
.ev-allday input { width: 16px; height: 16px; accent-color: var(--terracotta); }
.color-row { display: flex; gap: 8px; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .1s; }
.color-dot:hover { transform: scale(1.1); }
.color-dot.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }

/* ============================================================
   ESPACE TRAVAIL DE GROUPE
   ============================================================ */
.grp-tabs { display: flex; gap: 4px; padding: 8px 18px 0; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 49px; z-index: 3; }
.grp-tab { display: inline-flex; align-items: center; gap: 7px; border: none; background: none; padding: 9px 14px; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--text-muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.grp-tab svg { width: 17px; height: 17px; }
.grp-tab:hover { color: var(--text); }
.grp-tab.active { color: var(--terracotta-dk); border-bottom-color: var(--terracotta); }

#grp-code { font-variant-numeric: tabular-nums; }

.grp-content { height: calc(var(--app-h) - 49px - 46px); }

/* Chat */
.chat { display: flex; flex-direction: column; height: 100%; }
.chat__msgs { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; }
.chat__day { align-self: center; font-size: 11px; font-weight: 700; color: var(--warm-grey); background: var(--surface-2); padding: 3px 12px; border-radius: 99px; margin: 12px 0 8px; text-transform: capitalize; }
.msg { max-width: 78%; margin: 4px 0; display: flex; align-items: flex-end; gap: 8px; }
.msg.mine { margin-left: auto; flex-direction: row-reverse; }
.msg__av { flex: none; border: none; background: none; padding: 0; cursor: pointer; transition: transform .1s; }
.msg__av:hover { transform: scale(1.08); }
.msg__col { display: flex; flex-direction: column; min-width: 0; }
.msg.mine .msg__col { align-items: flex-end; }
.msg__author { font-size: 11.5px; color: var(--warm-grey); font-weight: 700; margin: 0 0 2px 12px; }
.msg__bubble { padding: 9px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); white-space: pre-wrap; word-break: break-word; line-height: 1.5; box-shadow: var(--shadow-sm); }
.msg.mine .msg__bubble { background: var(--terracotta); color: #fff; border-color: var(--terracotta); border-bottom-right-radius: 5px; }
.msg:not(.mine) .msg__bubble { border-bottom-left-radius: 5px; }
.msg__time { font-size: 10.5px; color: var(--warm-grey); margin: 3px 10px 0; }
.chat__bar { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--cream) 90%, transparent); backdrop-filter: blur(8px); }
.chat__bar input { flex: 1; padding: 11px 16px; border: 1px solid var(--border-strong); border-radius: 99px; font-family: inherit; font-size: 15px; outline: none; background: var(--surface); color: var(--text); }
.chat__bar input:focus { border-color: var(--nude); box-shadow: 0 0 0 3px var(--blush-soft); }
.chat__bar .btn { border-radius: 50%; width: 44px; height: 44px; padding: 0; flex: none; }
.chat__typing { height: 20px; padding: 0 24px; font-size: 12.5px; color: var(--warm-grey); font-style: italic; }
.chat__notif { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--blush-soft); border-bottom: 1px solid var(--blush); font-size: 13px; color: var(--terracotta-dk); font-weight: 600; }
.chat__notif svg { flex: none; color: var(--terracotta); }
.chat__notif span { flex: 1; }
.chat__notif .btn { padding: 6px 14px; flex: none; }

/* Badges non lus */
.rail__mod { position: relative; }
.rail__badge { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; background: #E0605C; color: #fff; border-radius: 99px; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid #4A413D; }
.rail__badge[hidden] { display: none; }
.grp-unread { background: var(--terracotta); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; flex: none; }

/* Notes partagées */
.gnotes { padding: 20px 24px 60px; }
.gnotes__bar { margin-bottom: 16px; }
.gnotes__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gnote-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: box-shadow .15s, transform .1s; }
.gnote-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.gnote-card__ic { color: var(--terracotta); }
.gnote-card__title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--text); }
.gnote-card__meta { font-size: 12px; color: var(--text-muted); }

.gnote-editor { max-width: 760px; margin: 0 auto; padding: 20px 24px 80px; }
.gnote-editor__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.gnote-editor__head .save-state { margin-left: auto; }
.gnote-editor #gn-title { font-size: 30px; margin-bottom: 14px; }
.gnote-editor .ql-toolbar.ql-snow { top: 104px; } /* sous les onglets du groupe */

/* Fichiers partagés */
.gfiles { padding: 20px 24px 60px; }
.gfiles__bar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.gfiles__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gfile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .1s; display: flex; flex-direction: column; }
.gfile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.gfile__preview { height: 120px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.gfile__preview img { width: 100%; height: 100%; object-fit: cover; }
.gfile__ic { color: var(--terracotta); }
.gfile__info { padding: 10px 12px 4px; }
.gfile__name { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gfile__meta { font-size: 11.5px; color: var(--text-muted); }
.gfile__actions { display: flex; justify-content: flex-end; gap: 2px; padding: 4px 8px 8px; }
.gfile__actions .btn-icon:last-child:hover { color: var(--danger); }

/* ============================================================
   ESPACE TÂCHES (Kanban)
   ============================================================ */
.board { height: calc(var(--app-h) - 49px); overflow: hidden; padding: 18px; }
.board__cols { display: flex; gap: 14px; height: 100%; overflow-x: auto; overflow-y: hidden; align-items: flex-start; padding-bottom: 8px; }
/* Colonnes à plat : fond crème translucide (lisible aussi sur une image de fond) */
.bcol {
  flex: none; width: 284px; max-height: 100%; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--offwhite) 94%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--border-strong);
  border-radius: var(--radius); overflow: hidden;
}
.bcol__head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 14px; }
.bcol__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.bcol__title { flex: 1; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: text; }
.bcol__count { background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--text-muted); border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 8px; }
.bcol--done .bcol__count { background: var(--ok-soft); color: var(--ok-ink); }
.bcol__menu { opacity: .5; }
.bcol__head:hover .bcol__menu { opacity: 1; }
.bcol__cards { flex: 1; overflow-y: auto; padding: 4px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 12px; }
.bcol__add { display: flex; align-items: center; gap: 6px; margin: 4px 8px 8px; border: none; background: none; color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: 700; padding: 8px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s, color .12s; }
.bcol__add:hover { color: var(--terracotta-dk); background: color-mix(in srgb, var(--surface) 80%, transparent); }

/* Cartes à plat */
.bcard {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  cursor: pointer; overflow: hidden; transition: border-color .12s;
}
.bcard:hover { border-color: var(--nude); }
.bcard.dragging { opacity: .4; }
.bcard.drag-ghost { height: 38px; padding: 0; background: color-mix(in srgb, var(--blush-soft) 60%, transparent); border: 1.5px dashed var(--nude); cursor: default; }
.bcard__cover { height: 30px; margin: -10px -12px 9px; }
.bcard__labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.bcard__label { font-size: 10.5px; font-weight: 800; border-radius: 99px; padding: 2px 9px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard__diff { display: inline-block; font-size: 10.5px; font-weight: 800; color: var(--d); background: color-mix(in srgb, var(--d) 16%, var(--mix-base)); border-radius: 99px; padding: 2px 9px; }
.bcard__title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; word-break: break-word; }
.bcard.is-done .bcard__title { color: var(--warm-grey); text-decoration: line-through; text-decoration-color: var(--soft-grey); }
.bcard__badge--icon { padding: 2px 5px; }
.bcard__assignee { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.board-addcol {
  flex: none; width: 240px; align-self: flex-start; display: flex; align-items: center; gap: 7px;
  background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1.5px dashed rgba(74,65,61,.22); color: var(--ink-soft);
  border-radius: var(--radius); padding: 12px 14px; font-family: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .12s, color .12s, border-color .12s;
}
.board-addcol:hover { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--terracotta-dk); border-color: var(--nude); }

/* Progression du tableau (barre du haut) */
.board-prog { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.board-prog[hidden] { display: none; }
.board-prog__bar { width: 90px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.board-prog__bar span { display: block; height: 100%; border-radius: 99px; background: var(--terracotta); transition: width .4s var(--ease); }
.board-prog__txt { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 700px) { .board-prog__txt { display: none; } }

/* Étiquettes (fenêtres) */
.tag-list { display: flex; flex-direction: column; gap: 8px; }
.tag-row { display: flex; align-items: center; gap: 10px; }
.tag-row__count { flex: 1; font-size: 12px; color: var(--warm-grey); }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; border-radius: 99px; padding: 4px 12px; border: none; font-family: inherit; }
.tag-pill svg { width: 13px; height: 13px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill--toggle { background: var(--tbg); color: var(--tfg); cursor: pointer; opacity: .55; transition: opacity .12s, box-shadow .12s; }
.tag-pill--toggle:hover { opacity: .85; }
.tag-pill--toggle.sel { opacity: 1; box-shadow: inset 0 0 0 1.5px var(--tsolid); }
.tag-pill--add { background: none; border: 1px dashed var(--border-strong); color: var(--text-muted); cursor: pointer; }
.tag-pill--add:hover { border-color: var(--nude); color: var(--terracotta-dk); }
.tag-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--cream); }
.tag-form__actions { display: flex; align-items: center; justify-content: space-between; }
.tag-colors { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-colors__dot, .cover-dot, .color-menu__dot {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(74,65,61,.1); cursor: pointer;
  display: grid; place-items: center; font-size: 13px; color: var(--warm-grey); padding: 0;
}
.tag-colors__dot.sel, .cover-dot.sel, .color-menu__dot.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--terracotta); }
.cover-dots { display: flex; flex-wrap: wrap; gap: 7px; }
.color-menu { padding: 10px; min-width: 0; }
.color-menu__grid { display: grid; grid-template-columns: repeat(5, 26px); gap: 8px; }

/* Choix (perso/groupe) */
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.choice { text-align: left; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; transition: background .12s, border-color .12s; }
.choice:hover { background: var(--blush-soft); border-color: var(--nude); }
.choice b { display: block; font-size: 14px; }
.choice span { font-size: 12px; color: var(--text-muted); }

/* Difficulté & assignation (modale carte) */
.diff-row, .assignee-row { display: flex; flex-wrap: wrap; gap: 8px; }
.diff { border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 5px 14px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.diff.sel { border-color: var(--d); color: var(--d); background: color-mix(in srgb, var(--d) 12%, var(--mix-base)); }
.assignee { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 4px 12px 4px 5px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.assignee.sel { border-color: var(--terracotta); background: var(--blush-soft); color: var(--terracotta-dk); }
.assignee--take { padding-left: 12px; color: var(--terracotta-dk); border-style: dashed; }

/* Pastilles de carte (échéance, check-list) */
.bcard__badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.bcard__badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-muted); }
.bcard__badge svg { opacity: .8; }
.bcard__badge.is-late { background: var(--danger-soft); color: var(--danger); }
.bcard__badge.is-soon { background: var(--warn-soft); color: var(--warn-ink); }
.bcard__badge.is-done { background: var(--ok-soft); color: #5f9e77; }

/* Échéance + check-list dans la modale carte */
.bc-duedone { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.bc-duedone input { width: 16px; height: 16px; accent-color: var(--terracotta); }
.checklist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.checklist__item { display: flex; align-items: center; gap: 8px; }
.checklist__check { width: 20px; height: 20px; flex: none; border: 2px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: #fff; display: grid; place-items: center; cursor: pointer; }
.checklist__item.done .checklist__check { background: var(--terracotta); border-color: var(--terracotta); }
.checklist__text { flex: 1; font-size: 14px; }
.checklist__item.done .checklist__text { text-decoration: line-through; color: var(--warm-grey); }
.checklist__del { opacity: 0; flex: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; }
.checklist__item:hover .checklist__del { opacity: .7; }
.checklist__del:hover { color: var(--danger); }
.checklist__add { display: flex; gap: 6px; }
.checklist__add input { flex: 1; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: inherit; font-size: 13.5px; outline: none; background: var(--surface); color: var(--text); }
.checklist__add input:focus { border-color: var(--nude); }

/* ============================================================
   ESPACE OBJECTIFS
   ============================================================ */
.goals { height: var(--app-h); overflow-y: auto; }
.goals-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 30px max(28px, calc((100% - 1040px) / 2)); /* aligné sur le contenu */
  background: linear-gradient(125deg, var(--blush-soft) 0%, var(--offwhite) 60%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}
.goals-hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 230px; height: 230px;
  background: url("../img/logo-mark.png") center/contain no-repeat; opacity: .28; pointer-events: none;
}
.goals-hero > * { position: relative; z-index: 1; }
.goals-hero__ring { position: relative; width: 88px; height: 88px; flex: none; }
.goals-hero__ring svg, .goal-ring-sm svg { transform: rotate(-90deg); }
.goals-hero__ring svg { width: 88px; height: 88px; }
.goals-hero__ring .ring-bg, .goal-ring-sm .ring-bg { fill: none; stroke: var(--border-strong); stroke-width: 7; }
.goals-hero__ring .ring-fg, .goal-ring-sm .ring-fg { fill: none; stroke: var(--terracotta); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.goals-hero__pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--terracotta-dk); }
.goals-hero__text { flex: 1; min-width: 200px; }
.goals-hero__text h1 { font-size: clamp(26px, 3.5vw, 34px); }
.goals-hero__text p { color: var(--ink-soft); margin: 3px 0 0; }
.goals-hero__quote { font-style: italic; color: var(--terracotta-dk) !important; }

.goals-body { max-width: 1096px; margin: 0 auto; padding: 22px 28px 90px; }

/* Chiffres clés */
.goal-stats { display: grid; grid-template-columns: repeat(3, 1fr) 1.6fr; gap: 12px; margin-bottom: 18px; }
.goal-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.goal-stat__ic { width: 30px; height: 30px; border-radius: 9px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; margin-bottom: 8px; }
.goal-stat b { font-family: var(--font-display); font-size: 24px; line-height: 1.1; color: var(--text); }
.goal-stat b small { font-size: 15px; color: var(--warm-grey); }
.goal-stat > span:last-child { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.goal-stat__txt { font-size: 16px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 5px; }

/* Filtres par catégorie */
.goal-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.goal-filter {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 99px; padding: 5px 12px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.goal-filter i { width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
.goal-filter span { font-size: 11px; color: var(--warm-grey); font-weight: 800; }
.goal-filter:hover { border-color: var(--nude); }
.goal-filter.active { background: var(--solid); border-color: var(--solid); color: #fff; }
.goal-filter.active span { color: rgba(255,255,255,.7); }

/* Mise en page : colonne principale + panneau latéral */
.goals-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: start; }
.goals-section { margin-bottom: 24px; }
.goals-section__title { display: flex; align-items: center; gap: 7px; font-family: var(--font-body); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); margin: 0 0 10px; }
.goals-section__title svg { color: var(--nude); }
.goals-section__title span { background: var(--surface-2); color: var(--text-muted); border-radius: 99px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; }
.goals-done summary { cursor: pointer; list-style: none; }
.goals-done summary::-webkit-details-marker { display: none; }
.goals-done summary > svg:last-child { transition: transform .15s; color: var(--warm-grey); }
.goals-done[open] summary > svg:last-child { transform: rotate(90deg); }
.goals-none { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-muted); margin-bottom: 24px; }
.goals-none svg { color: var(--nude); flex: none; }

.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.goal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px 18px; cursor: pointer;
  transition: border-color .15s;
}
.goal-card:hover { border-color: var(--nude); }
.goal-card.is-done { background: var(--cream); }
.goal-card.is-done .goal-card__title { color: var(--ink-soft); }
.goal-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.goal-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; color: var(--cat); text-transform: uppercase; letter-spacing: .3px; }
.goal-cat__ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--cat) 18%, var(--mix-base)); }
.goal-due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); padding: 2px 8px; border-radius: 99px; }
.goal-due.is-late { background: var(--danger-soft); color: var(--danger); }
.goal-due.is-soon { background: var(--warn-soft); color: var(--warn-ink); }
.goal-due.is-done { background: var(--ok-soft); color: #5f9e77; }
.goal-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; color: #5f9e77; }
.goal-badge svg { width: 13px; height: 13px; }
.goal-card__main { display: flex; align-items: flex-start; gap: 14px; }
.goal-card__head { flex: 1; min-width: 0; }
.goal-card__title { font-size: 17px; margin-bottom: 4px; }
.goal-card__why { display: flex; align-items: flex-start; gap: 5px; font-size: 12.5px; color: var(--text-muted); font-style: italic; margin: 0 0 12px; }
.goal-card__why svg { flex: none; margin-top: 2px; color: var(--nude); }
.goal-prog { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.goal-prog__bar { height: 100%; background: linear-gradient(90deg, var(--nude), var(--cat, var(--terracotta))); border-radius: 99px; transition: width .4s ease; }
.goal-card__foot { display: flex; align-items: center; justify-content: space-between; }
.goal-pct { font-family: var(--font-display); font-weight: 700; color: var(--cat, var(--terracotta-dk)); }
.goal-ms { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Étapes cochables directement sur la carte */
.goal-steps { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 2px; }
.goal-step {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; border: none; background: none;
  padding: 4px 6px; margin: 0 -6px; border-radius: 7px; font-family: inherit; font-size: 13.5px; color: var(--ink-soft); cursor: pointer;
}
.goal-step:hover { background: var(--surface-2); color: var(--text); }
.goal-step__box { width: 16px; height: 16px; flex: none; margin-top: 2px; border: 1.5px solid var(--soft-grey); border-radius: 5px; background: var(--surface); transition: background .12s, border-color .12s; }
.goal-step:hover .goal-step__box { border-color: var(--cat, var(--nude)); }
.goal-step.is-checking .goal-step__box { background: var(--cat, var(--terracotta)); border-color: var(--cat, var(--terracotta)); }
.goal-steps__more { font-size: 12px; color: var(--warm-grey); padding: 3px 0 0 25px; }

/* Carte mise en avant */
.goal-card--featured { padding: 20px 22px 16px 24px; background: linear-gradient(135deg, var(--surface) 55%, color-mix(in srgb, var(--cat) 10%, var(--mix-base))); }
.goal-card--featured .goal-card__title { font-size: 22px; }
.goal-card--featured .goal-steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 18px; }
.goal-ring-sm { position: relative; width: 64px; height: 64px; flex: none; }
.goal-ring-sm svg { width: 64px; height: 64px; }
.goal-ring-sm .ring-bg, .goal-ring-sm .ring-fg { stroke-width: 5; }
.goal-ring-sm .ring-fg { stroke: var(--cat, var(--terracotta)); }
.goal-ring-sm span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); }
.goal-card__foot--featured { margin-top: 12px; }
.goal-open { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--terracotta-dk); }

/* Panneau latéral */
.goals-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.goal-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.goal-panel h3 { font-family: var(--font-body); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); margin-bottom: 12px; }
.goal-panel__empty { font-size: 13px; color: var(--text-muted); margin: 0; }
.cat-bar { margin-bottom: 11px; }
.cat-bar:last-child { margin-bottom: 0; }
.cat-bar__top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 5px; }
.cat-bar__top span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-weight: 600; }
.cat-bar__top svg { color: var(--cat); }
.cat-bar__top b { font-size: 12px; color: var(--text-muted); }
.cat-bar__track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.cat-bar__track span { display: block; height: 100%; border-radius: 99px; background: var(--cat); }
.due-row { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; padding: 6px 6px; margin: 0 -6px; border-radius: 7px; font-family: inherit; cursor: pointer; text-align: left; }
.due-row:hover { background: var(--surface-2); }
.due-row__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.due-row__title { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-row__d { font-size: 11.5px; font-weight: 800; color: var(--text-muted); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.due-row__d.is-soon { background: var(--warn-soft); color: var(--warn-ink); }
.due-row__d.is-late { background: var(--danger-soft); color: var(--danger); }

/* Premier lancement : idées d'objectifs */
.goals-empty { text-align: center; max-width: 640px; margin: 30px auto 0; }
.goals-empty img { width: 76px; opacity: .85; margin: 0 auto 14px; }
.goals-empty h3 { font-size: 24px; margin-bottom: 6px; }
.goals-empty p { color: var(--text-muted); margin: 0 auto 22px; max-width: 480px; }
.goal-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; text-align: left; }
.goal-template { display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 12px 14px; font-family: inherit; cursor: pointer; transition: border-color .12s; }
.goal-template:hover { border-color: var(--cat); }
.goal-template__ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--cat); background: color-mix(in srgb, var(--cat) 16%, var(--mix-base)); }
.goal-template b { display: block; font-size: 14px; color: var(--text); }
.goal-template small { display: block; font-size: 12px; color: var(--text-muted); }

@media (max-width: 980px) {
  .goals-layout { grid-template-columns: minmax(0, 1fr); }
  .goals-aside { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .goal-stats { grid-template-columns: repeat(3, 1fr); }
  .goal-stat--wide { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .goals-aside { grid-template-columns: minmax(0, 1fr); }
  .goals-body { padding: 18px 14px 80px; }
  .goals-hero { padding: 24px 14px; gap: 16px; }
  .goals-hero__ring, .goals-hero__ring svg { width: 70px; height: 70px; }
  .goals-hero .btn-lg { width: 100%; }
  /* Chiffres clés compacts */
  .goal-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .goal-stat { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
  .goal-stat__ic { margin-bottom: 0; flex: none; }
  .goal-stat b { font-size: 20px; }
  .goal-stat--wide { flex-wrap: wrap; }
  .goal-stat--wide .goal-stat__txt { padding-top: 0; max-width: calc(100% - 40px); }
  .goal-card--featured .goal-steps { grid-template-columns: 1fr; }
}

/* Système d'étapes (modale objectif) */
.steps-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.steps-head label { margin: 0; }
.steps-prog { font-size: 12.5px; font-weight: 700; color: var(--terracotta-dk); }
.steps-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-bottom: 10px; }
.steps-bar__fill { height: 100%; background: linear-gradient(90deg, var(--nude), var(--terracotta)); border-radius: 99px; transition: width .3s ease; }
.steps { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.step { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid transparent; }
.step:hover { background: var(--surface-2); }
.step.dragging { opacity: .5; }
.step__grip { color: var(--soft-grey); cursor: grab; display: inline-flex; flex: none; }
.step__check { width: 20px; height: 20px; flex: none; border: 2px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: #fff; display: grid; place-items: center; cursor: pointer; }
.step.done .step__check { background: var(--terracotta); border-color: var(--terracotta); }
.step__text { flex: 1; font-size: 14px; cursor: text; padding: 2px 0; }
.step.done .step__text { text-decoration: line-through; color: var(--warm-grey); }
.step__edit { flex: 1; font: inherit; font-size: 14px; padding: 3px 7px; border: 1px solid var(--nude); border-radius: 6px; outline: none; box-shadow: 0 0 0 3px var(--blush-soft); }
.step__del { opacity: 0; flex: none; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; }
.step:hover .step__del { opacity: .6; }
.step__del:hover { color: var(--danger); }

/* Catégories (modale objectif) */
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.cat.sel { border-color: var(--cat); color: var(--cat); background: color-mix(in srgb, var(--cat) 12%, var(--mix-base)); }
.goal-range { width: 100%; accent-color: var(--terracotta); }

/* Célébration : pétales */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.petal { position: absolute; top: -20px; width: 14px; height: 14px; border-radius: 14px 1px 14px 1px; opacity: .9; animation: petal-fall linear forwards; }
@keyframes petal-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(102vh) rotate(540deg); opacity: .4; }
}

/* ============================================================
   ESPACE CODE (snippets)
   ============================================================ */
/* Filtres par langage */
.snip-langs { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 12px 6px; }
.snip-langs:empty { display: none; }
.snip-chip {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: 99px; padding: 2px 9px; font-family: inherit; font-size: 11px; font-weight: 800; color: var(--text-muted);
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.snip-chip i { width: 7px; height: 7px; border-radius: 50%; }
.snip-chip:hover { border-color: var(--nude); color: var(--text); }
.snip-chip.active { background: var(--blush-soft); border-color: var(--nude); color: var(--terracotta-dk); }

/* Liste */
.snip-item {
  display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; color: var(--ink-soft);
  transition: background .12s;
}
.snip-item:hover { background: var(--blush-soft); }
.snip-item.active { background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.snip-item__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.snip-item__txt { display: flex; flex-direction: column; min-width: 0; }
.snip-item__txt b { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.snip-item.active .snip-item__txt b { color: var(--terracotta-dk); }
.snip-item__txt small { font-size: 11.5px; color: var(--warm-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Page d'un snippet */
.snip { max-width: 860px; }
.snip__title {
  width: 100%; border: none; background: none; outline: none; padding: 0; margin: 0 0 12px;
  font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--text); letter-spacing: -.01em;
}
.snip__title::placeholder { color: var(--soft-grey); }
.snip__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.snip-tags {
  flex: 1; min-width: 180px; height: 32px; border: 1px dashed var(--border-strong); background: transparent; border-radius: 99px;
  padding: 0 14px; font-family: inherit; font-size: 13px; color: var(--terracotta-dk); font-weight: 700; outline: none;
}
.snip-tags::placeholder { color: var(--warm-grey); font-weight: 400; }
.snip-tags:focus { border-style: solid; border-color: var(--nude); background: var(--surface); box-shadow: var(--ring); }

/* Éditeur de code : fenêtre sombre chaude */
.codebox { background: #2B2624; border-radius: var(--radius); overflow: hidden; border: 1px solid #3A3330; }
.codebox__bar { display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 14px; border-bottom: 1px solid #3A3330; background: #312B28; }
.codebox__dots { display: inline-flex; gap: 6px; }
.codebox__dots i { width: 10px; height: 10px; border-radius: 50%; background: #4A413D; }
.codebox__dots i:first-child { background: #D9A79E; }
.codebox__lang { font-size: 12px; font-weight: 800; color: #E9D9D2; letter-spacing: .3px; }
.codebox__lines { font-size: 11.5px; color: #8C807A; margin-right: auto; }
.codebox__copy {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #4A413D; background: transparent; color: #E9D9D2;
  border-radius: 8px; padding: 4px 10px; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.codebox__copy svg { width: 14px; height: 14px; }
.codebox__copy:hover { background: #3A3330; }
.codebox__copy.done { border-color: #7FAE86; color: #A9D3AF; }
.codebox__body { display: flex; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 13.5px; line-height: 1.65; }
.codebox__gutter { flex: none; padding: 14px 10px 14px 14px; text-align: right; color: #6B605A; user-select: none; display: flex; flex-direction: column; min-width: 42px; }
.codebox__scroll { flex: 1; min-width: 0; overflow-x: auto; }
.codebox__stack { display: grid; min-width: 100%; width: max-content; }
.codebox__stack > * { grid-area: 1 / 1; }
.codebox__hl, .codebox__input {
  margin: 0; padding: 14px 18px 14px 4px; font: inherit; line-height: inherit; white-space: pre; tab-size: 2;
  border: none; letter-spacing: 0; word-spacing: 0;
}
.codebox__hl { pointer-events: none; color: #EDE3DC; }
.codebox__hl code.hljs { background: none; padding: 0; font: inherit; color: inherit; }
.codebox__input {
  resize: none; overflow: hidden; background: transparent; color: transparent; caret-color: #F3C9BE; outline: none;
  min-height: 180px; width: 100%;
}
.codebox__input::placeholder { color: #7D716B; }
.codebox__input::selection { background: rgba(217,167,158,.35); color: transparent; }

/* Couleurs syntaxiques (palette Taskora) */
.codebox .hljs-comment, .codebox .hljs-quote { color: #8C807A; font-style: italic; }
.codebox .hljs-keyword, .codebox .hljs-selector-tag, .codebox .hljs-meta .hljs-keyword, .codebox .hljs-doctag { color: #E59A8C; }
.codebox .hljs-string, .codebox .hljs-regexp, .codebox .hljs-addition, .codebox .hljs-meta .hljs-string { color: #A9CFA0; }
.codebox .hljs-number, .codebox .hljs-literal, .codebox .hljs-symbol, .codebox .hljs-bullet { color: #E8B77A; }
.codebox .hljs-title, .codebox .hljs-title.function_, .codebox .hljs-section { color: #F0C8A8; }
.codebox .hljs-title.class_, .codebox .hljs-type, .codebox .hljs-built_in { color: #C9A9E0; }
.codebox .hljs-attr, .codebox .hljs-attribute, .codebox .hljs-property, .codebox .hljs-variable, .codebox .hljs-template-variable { color: #9FC4D6; }
.codebox .hljs-tag, .codebox .hljs-name, .codebox .hljs-selector-id, .codebox .hljs-selector-class { color: #E59A8C; }
.codebox .hljs-params { color: #EDE3DC; }
.codebox .hljs-meta { color: #C9B4A8; }
.codebox .hljs-deletion { color: #E58A8A; }
.codebox .hljs-emphasis { font-style: italic; }
.codebox .hljs-strong { font-weight: 700; }



/* ----- Blocs d'un snippet ----- */
.blocks { display: flex; flex-direction: column; gap: 14px; }
.blk { position: relative; }
.blk-empty { color: var(--text-muted); font-size: 14px; padding: 18px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); margin: 0; }
/* Outils du bloc (monter / descendre / supprimer) : visibles au survol, à droite */
.blk__tools {
  position: absolute; right: -44px; top: 4px; display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transition: opacity .15s;
}
.blk:hover .blk__tools, .blk:focus-within .blk__tools { opacity: 1; }
.blk__tool { width: 28px; height: 26px; border: none; background: none; border-radius: 7px; color: var(--warm-grey); display: grid; place-items: center; cursor: pointer; }
.blk__tool:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.blk__tool--del:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }
.blk__tool:disabled { opacity: .3; cursor: default; }
.blk__tool svg { width: 15px; height: 15px; }
@media (max-width: 1100px) {
  .blk__tools { position: static; flex-direction: row; justify-content: flex-end; opacity: 1; margin-bottom: 4px; }
}

/* En-tête du bloc de code : nom de fichier + langage */
.codebox__file {
  border: none; background: transparent; outline: none; color: #E9D9D2; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px; font-weight: 600; width: 160px; min-width: 60px; padding: 3px 6px; border-radius: 6px;
}
.codebox__file::placeholder { color: #7D716B; font-weight: 400; }
.codebox__file:focus { background: #3A3330; }
.codebox__langsel {
  border: 1px solid #4A413D; background: #2B2624; color: #E9D9D2; border-radius: 7px; padding: 3px 6px;
  font-family: inherit; font-size: 12px; font-weight: 700; outline: none; cursor: pointer;
}
.codebox__langsel:focus { border-color: #D9A79E; }
.codebox .codebox__lines { margin-left: auto; margin-right: 0; }
.codebox__bar .codebox__copy { margin-left: 4px; }
/* Terminal : fond plus sombre, invite « $ » */
.codebox--term { background: #221E1C; }
.codebox--term .codebox__bar { background: #2A2522; }
.codebox--term .codebox__gutter { color: #A9CFA0; min-width: 30px; padding-right: 6px; }
.codebox--term .codebox__input, .codebox--term .codebox__hl { min-height: 0; }
.codebox--term .codebox__input { min-height: 46px; }

/* Texte */
.blk-text {
  width: 100%; border: none; background: transparent; outline: none; resize: none; overflow: hidden; padding: 4px 2px;
  font-family: inherit; font-size: 15.5px; line-height: 1.7; color: var(--text);
}
.blk-text::placeholder { color: var(--soft-grey); }

/* Encadré (astuce / attention / info) */
.callout { display: flex; align-items: flex-start; gap: 10px; border-radius: var(--radius); padding: 12px 14px; background: var(--blush-soft); border: 1px solid var(--blush); }
.callout__kind {
  display: inline-flex; align-items: center; gap: 6px; flex: none; border: none; background: color-mix(in srgb, var(--surface) 70%, transparent);
  border-radius: 99px; padding: 3px 10px 3px 7px; font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer; color: var(--terracotta-dk);
}
.callout__kind svg { width: 16px; height: 16px; }
.callout__kind:hover { background: var(--surface); }
.callout__text {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none; resize: none; overflow: hidden;
  font-family: inherit; font-size: 15px; line-height: 1.6; color: var(--text); padding: 2px 0;
}
.callout__text::placeholder { color: var(--warm-grey); }
.blk--callout-warn .callout { background: var(--warn-soft); border-color: var(--warn-line); }
.blk--callout-warn .callout__kind { color: #9A6B1F; }
.blk--callout-info .callout { background: var(--info-soft); border-color: var(--info-line); }
.blk--callout-info .callout__kind { color: #3F6E96; }

/* Lien */
.linkblk { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.linkblk__ic { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.linkblk__fields { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.linkblk__fields input { border: none; background: none; outline: none; font-family: inherit; padding: 1px 0; min-width: 0; }
.linkblk__label { font-size: 14.5px; font-weight: 700; color: var(--text); }
.linkblk__url { font-size: 12.5px; color: var(--terracotta-dk); }
.linkblk__label::placeholder, .linkblk__url::placeholder { color: var(--soft-grey); font-weight: 400; }
.linkblk__open { width: 32px; height: 32px; flex: none; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); }
.linkblk__open:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
.linkblk__open.is-off { opacity: .3; pointer-events: none; }

/* Ajouter un bloc */
.blk-add { margin-top: 16px; }
.blk-add__btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px dashed var(--border-strong); background: transparent;
  border-radius: var(--radius-sm); padding: 9px 14px; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-muted); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.blk-add__btn svg { color: var(--terracotta); width: 16px; height: 16px; }
.blk-add__btn:hover { background: var(--surface); border-color: var(--nude); color: var(--text); }
.blk-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; animation: pop .18s var(--ease); }
.blk-picker[hidden] { display: none; }
.blk-picker__item {
  display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; cursor: pointer; transition: border-color .12s, background .12s;
}
.blk-picker__item:hover { border-color: var(--nude); background: var(--cream); }
.blk-picker__ic { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.blk-picker__ic svg { width: 18px; height: 18px; }
.blk-picker__item b { display: block; font-size: 13.5px; color: var(--text); }
.blk-picker__item small { display: block; font-size: 12px; color: var(--text-muted); }

/* Partage d'un snippet avec un groupe */
.snip-share {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 11px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--terracotta);
}
.snip-share svg { width: 16px; height: 16px; flex: none; }
.snip-share .scope-select { border: none; background: none; padding: 4px 6px; font-weight: 700; max-width: 190px; }
.snip-share:focus-within { border-color: var(--nude); box-shadow: var(--ring); }
.snip-shared {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 99px;
  background: var(--blush-soft); color: var(--terracotta-dk); font-size: 12.5px;
}
.snip-shared svg { width: 16px; height: 16px; flex: none; }
.snip-item__grp { display: inline-flex; align-items: center; gap: 3px; color: var(--terracotta); font-weight: 700; }
.snip-item__grp svg { width: 12px; height: 12px; }
.gnotes__bar { display: flex; gap: 8px; flex-wrap: wrap; }
.gnote-card--code .gnote-card__ic { color: #D8A93B; }
.gnote-card__lang { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: var(--text-muted); }
.gnote-card__lang i { width: 7px; height: 7px; border-radius: 50%; }
/* ============================================================
   ESPACE ADMIN
   ============================================================ */
.rail__mod--admin { width: 40px; height: 40px; border-radius: 12px; background: transparent; border: 1px solid rgba(255,255,255,.14); }
.rail__mod--admin .rail__mod-ico svg { width: 18px; height: 18px; }
.rail__mod--admin.active::before { left: -16px; }
.module--wide { max-width: 1000px; }
.adm-tabs { display: inline-flex; margin-top: 16px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.adm-loading { display: grid; place-items: center; padding: 60px 0; }

.adm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.adm-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.adm-tile__ic { width: 32px; height: 32px; border-radius: 10px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; margin-bottom: 10px; }
.adm-tile__ic svg { width: 17px; height: 17px; }
.adm-tile b { font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--text); }
.adm-tile > span:last-child { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.adm-card--flush { padding: 0; overflow: hidden; }
.adm-card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.adm-card__head h3 { font-size: 18px; }
.adm-card__head .muted { font-size: 12.5px; }

.adm-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 150px; align-items: end; }
.adm-bar { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.adm-bar__fill { width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--terracotta), var(--nude)); transition: height .4s var(--ease); }
.adm-bar__n { font-size: 11px; font-weight: 700; color: var(--terracotta-dk); min-height: 14px; }
.adm-bar__d { font-size: 11px; color: var(--warm-grey); }

.adm-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.adm-counts div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.adm-counts b { font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.adm-counts span { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.adm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.adm-toolbar .muted { font-size: 13px; }
.adm-search { margin: 0; flex: 1; max-width: 360px; }

.adm-row { display: grid; grid-template-columns: minmax(0, 2.4fr) 1fr 1fr .6fr .6fr 40px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--ink-soft); }
.adm-table--groups .adm-row { grid-template-columns: minmax(0, 2fr) 1.2fr 1fr .7fr .7fr 1fr; }
.adm-row:not(.adm-row--head):hover { background: var(--cream); }
.adm-row--head { border-top: none; background: var(--surface-2); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-grey); font-weight: 800; padding-top: 9px; padding-bottom: 9px; }
.adm-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-user__txt { display: flex; flex-direction: column; min-width: 0; }
.adm-user__txt b, .adm-user > b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user__txt small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-badge { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--terracotta-dk); background: var(--blush-soft); border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.adm-badge--me { color: var(--ink-soft); background: var(--surface-2); }
.adm-badge--ban { color: var(--danger); background: var(--danger-soft); }
.adm-tile--link { cursor: pointer; transition: border-color .15s, transform .15s; }
.adm-tile--link:hover { border-color: var(--nude); transform: translateY(-1px); }
.adm-note { font-size: 13px; margin: -2px 0 14px; line-height: 1.5; }

/* Modération */
.adm-mods { display: flex; flex-direction: column; gap: 10px; }
.adm-mod { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.adm-mod.is-hidden { border-color: var(--danger-line); }
.adm-mod__img { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.adm-mod__img--ic { display: grid; place-items: center; color: var(--warm-grey); }
.adm-mod__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.adm-mod__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.adm-mod__top .adm-badge { margin-left: 0; }
.adm-mod__n { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--danger); }
.adm-mod__title { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.adm-mod__ex { margin: 0; font-size: 13.5px; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-mod__why { display: flex; flex-wrap: wrap; gap: 5px; }
.adm-mod__why span { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); font-weight: 700; }
.adm-mod__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.adm-mod__acts .btn { padding: 6px 12px; font-size: 13px; }
.btn.adm-danger { color: var(--danger); border-color: var(--danger-line); }
.btn.adm-danger:hover { background: var(--danger-soft); }

/* Mots interdits */
.adm-words__add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.adm-words__add .input { flex: 1 1 220px; }
.adm-words__pref { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.adm-words { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-word { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text); }
.adm-word button { width: 22px; height: 22px; border: none; border-radius: 50%; background: transparent; color: var(--warm-grey); display: grid; place-items: center; cursor: pointer; }
.adm-word button:hover { background: var(--danger-soft); color: var(--danger); }
.adm-word button svg { width: 12px; height: 12px; }

/* Explorer : contenus masqués et charte */
.pin__hidden { display: none; }
.pin.is-hidden .pin__hidden {
  display: inline-flex; align-items: center; gap: 5px; position: absolute; left: 10px; bottom: 10px; z-index: 2;
  padding: 4px 10px; border-radius: 99px; background: rgba(40, 33, 30, .78); color: #fff; font-size: 11.5px; font-weight: 800;
}
.pin__hidden svg { width: 12px; height: 12px; }
.pin.is-hidden .pin__media > :first-child { opacity: .55; filter: grayscale(.4); }
.pd__hidden { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.45; }
.pd__hidden svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.pd-cmt.is-hidden .pd-cmt__body p { opacity: .55; }
.pd-cmt__hidden { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--danger); }
.pd-cmt__hidden svg { width: 12px; height: 12px; }
.charter { margin: 0 0 14px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.charter li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.charter li::before { content: "🌸"; position: absolute; left: 0; top: 0; font-size: 13px; }
.charter b { color: var(--text); }
@media (max-width: 760px) {
  .adm-tabs { display: flex; flex-wrap: wrap; border-radius: 16px; max-width: 100%; }
  .adm-tabs .seg { flex: 1 1 auto; white-space: nowrap; }
}
@media (max-width: 620px) {
  .adm-mod { flex-direction: column; }
  .adm-mod__img { width: 100%; height: 120px; }
  .adm-mod__img--ic { display: none; }
}
.adm-gic { width: 32px; height: 32px; flex: none; border-radius: 10px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.adm-gic svg { width: 17px; height: 17px; }
.adm-empty { padding: 30px 16px; text-align: center; border-top: 1px solid var(--border); }

@media (max-width: 760px) {
  .adm-tiles { grid-template-columns: repeat(2, 1fr); }
  .adm-row, .adm-table--groups .adm-row { grid-template-columns: minmax(0, 1fr) auto; }
  .adm-row > span:not(:first-child):not(:last-child) { display: none; }
  .adm-table--groups .adm-row > span:last-child { display: none; }
  .adm-chart { gap: 3px; }
}


/* ---------- Rappels v2 ---------- */
.rem-hero--wide .rem-hero__content { max-width: 1040px; }
.rem-page { max-width: 1096px; margin: 0 auto; padding: 0 28px 90px; }
/* Ajout rapide */
.rem-add {
  position: relative; z-index: 2; margin: 20px 0 16px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 8px 8px 10px 14px;
}
.rem-add:focus-within { border-color: var(--nude); box-shadow: var(--ring); }
.rem-add__row { display: flex; align-items: center; gap: 10px; }
.rem-add__plus { color: var(--terracotta); display: inline-flex; flex: none; }
.rem-add #rq-title { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: inherit; font-size: 15.5px; color: var(--text); padding: 6px 0; }
.rem-add__opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.rem-when { display: flex; flex-wrap: wrap; gap: 5px; margin-right: auto; }
.rem-when__chip {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 4px 11px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.rem-when__chip:hover { border-color: var(--nude); color: var(--text); }
.rem-when__chip.sel { background: var(--blush-soft); border-color: var(--nude); color: var(--terracotta-dk); }
.rem-add #rq-due { border: 1px solid var(--border); outline: none; background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 8px; font-family: inherit; font-size: 12.5px; color: var(--text-muted); }
.rem-add #rq-due:focus { border-color: var(--nude); }
.rem-add .scope-select { padding: 6px 8px; }

/* Chiffres clés : tuiles compactes (icône + nombre + libellé sur une ligne) */
.goal-stats.rem-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; gap: 10px; }
@media (max-width: 760px) {
  /* Compteurs des rappels : 2 par ligne pour ne plus couper « aujourd'hui » */
  .goal-stats.rem-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
.rem-stats .goal-stat { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
.rem-stats .goal-stat__ic { margin-bottom: 0; flex: none; }
.rem-stats .goal-stat b { font-size: 22px; }
.rem-stats .goal-stat > span:last-child { line-height: 1.25; }
.goal-stat.is-zero b { color: var(--soft-grey); }
.rem-stat--late:not(.is-zero) .goal-stat__ic { background: var(--danger-soft); color: var(--danger); }
.rem-stat--late:not(.is-zero) b { color: var(--danger); }
.rem-stat--today .goal-stat__ic { background: var(--warn-soft); color: #B7822E; }
.rem-stat--done .goal-stat__ic { background: var(--ok-soft); color: #5f9e77; }

/* Sections */
.rem-sec--overdue .goals-section__title { color: var(--danger); }
.rem-sec--overdue .goals-section__title svg { color: var(--danger); }
.rem-sec--today .goals-section__title { color: var(--terracotta-dk); }
.rem-sec--today .goals-section__title svg { color: var(--terracotta); }
.rem-list { display: flex; flex-direction: column; gap: 6px; }
.rem-day { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); margin: 10px 0 2px 2px; }
.rem-day:first-child { margin-top: 0; }
.rem-clear { margin-left: auto; font-size: 12px; text-transform: none; letter-spacing: 0; }

/* Ligne de rappel à plat */
.rem-list .rem { margin-bottom: 0; padding: 11px 14px; transition: border-color .12s, opacity .18s; }
.rem-list .rem:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--nude); }
.rem__check { color: transparent; }
.rem__check svg { width: 13px; height: 13px; }
.rem__check:hover { color: var(--nude); }
.rem--done .rem__check { color: #fff; }
.rem.is-checking { opacity: .45; }
.rem.is-checking .rem__check { background: #8FB996; border-color: #8FB996; color: #fff; }
.rem__due { gap: 8px; flex-wrap: wrap; }
.rem__when { display: inline-flex; align-items: center; gap: 4px; }
.rem__late { font-size: 11px; font-weight: 800; color: var(--danger); background: var(--danger-soft); border-radius: 99px; padding: 1px 7px; }
.rem__shared { margin-left: 0; }
/* Frise « Aujourd'hui » : l'heure à gauche */
.rem--timeline { gap: 12px; }
.rem__time { flex: none; width: 52px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--terracotta-dk); text-align: right; padding-right: 10px; border-right: 1px solid var(--border); }
.rem__time:not(:empty) { line-height: 1.2; }
.rem--nodate { --bar: var(--soft-grey); }

/* Mini-calendrier */
.mcal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mcal__head h3 { margin: 0 !important; text-transform: capitalize !important; letter-spacing: .5px !important; color: var(--text) !important; font-size: 13px !important; }
.mcal__head .btn-icon { font-size: 18px; line-height: 1; width: 26px; height: 26px; }
.mcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mcal__dow { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--warm-grey); padding-bottom: 3px; }
.mcal__day {
  position: relative; height: 32px; border: none; background: none; border-radius: 8px; font-family: inherit; font-size: 12.5px;
  font-weight: 600; color: var(--text); cursor: pointer; display: grid; place-items: center; transition: background .1s;
}
.mcal__day:hover { background: var(--blush-soft); }
.mcal__day.is-past { color: var(--soft-grey); }
.mcal__day.is-today { background: var(--terracotta); color: #fff; }
.mcal__day i { position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--terracotta); }
.mcal__day.is-today i { background: var(--surface); }
.mcal__hint { font-size: 11.5px; color: var(--warm-grey); margin: 8px 0 0; text-align: center; }
.rem-filters { display: flex; flex-direction: column; gap: 2px; }
.rem-filter {
  display: flex; align-items: center; gap: 8px; border: none; background: none; border-radius: 7px; padding: 6px 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; text-align: left;
}
.rem-filter svg { width: 15px; height: 15px; color: var(--warm-grey); flex: none; }
.rem-filter span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rem-filter:hover { background: var(--surface-2); }
.rem-filter.active { background: var(--blush-soft); color: var(--terracotta-dk); font-weight: 800; }
.rem-filter.active svg { color: var(--terracotta); }

@media (max-width: 980px) {
  .goal-stats.rem-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .rem-page { padding: 0 14px 80px; }
  .rem-hero { padding-left: 14px; padding-right: 14px; }
  .rem-add #rq-due { flex: 1; min-width: 0; }
  .rem-add .scope-select { flex: 1; max-width: none; }
  .rem-when { margin-right: 0; flex-basis: 100%; }
  .rem__time { width: 44px; font-size: 13.5px; padding-right: 8px; }
  .rem-list .rem { padding: 10px 12px; gap: 10px; }
  .rem__edit, .rem__del { display: none; } /* au doigt : on ouvre le rappel pour le modifier */
}
/* ---------- Calendrier v2 ---------- */
.cal-main { display: flex; flex-direction: column; overflow: hidden; }
.cal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 22px 12px; border-bottom: 1px solid var(--border);
  background: linear-gradient(125deg, var(--blush-soft) 0%, var(--offwhite) 55%, var(--surface) 100%);
}
.cal-bar__left, .cal-bar__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-label { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 0; min-width: 0; }
.cal-nav { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 99px; padding: 2px; }
.cal-nav__btn { width: 30px; height: 30px; border: none; background: none; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.cal-nav__btn:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
.cal-nav__today { border: none; background: none; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text); padding: 5px 10px; border-radius: 99px; cursor: pointer; }
.cal-nav__today:hover { background: var(--blush-soft); }
.cal-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer; user-select: none; }
.cal-toggle input { display: none; }
.cal-toggle svg { width: 16px; height: 16px; color: var(--warm-grey); }
.cal-toggle__sw { width: 30px; height: 18px; border-radius: 99px; background: var(--soft-grey); position: relative; transition: background .15s; }
.cal-toggle__sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s var(--ease); }
.cal-toggle input:checked + .cal-toggle__sw { background: var(--terracotta); }
.cal-toggle input:checked + .cal-toggle__sw::after { transform: translateX(12px); }

.cal-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.cal { min-width: 0; min-height: 0; padding: 14px 16px 16px 22px; display: flex; flex-direction: column; }
.cal-aside { border-left: 1px solid var(--border); background: var(--offwhite); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }

/* Vue mois */
.cal-grid--month { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head div { padding: 4px 8px 8px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-grey); font-weight: 800; }
.cal-head div.we { color: var(--nude); }
.cal-weeks {
  flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(var(--weeks), minmax(92px, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.cal-cell {
  position: relative; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 5px 5px 4px;
  min-height: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: background .1s;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.we { background: var(--cal-we); }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-cell__num { color: var(--soft-grey); }
.cal-cell:hover { background: var(--cream); }
.cal-cell.sel { background: var(--cal-sel); box-shadow: inset 0 0 0 1.5px var(--nude); }
.cal-cell__top { display: flex; align-items: center; justify-content: space-between; }
.cal-cell__num { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-cell__num { background: var(--terracotta); color: #fff; }
.cal-cell__add { width: 22px; height: 22px; border: none; background: none; border-radius: 6px; color: var(--warm-grey); display: grid; place-items: center; opacity: 0; cursor: pointer; transition: opacity .12s, background .12s; }
.cal-cell__add svg { width: 14px; height: 14px; }
.cal-cell:hover .cal-cell__add { opacity: 1; }
.cal-cell__add:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
.cal-cell__events { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: hidden; }
.cal-cell__dots { display: none; }
.cal-chip {
  display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; border: none; text-align: left; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600; color: var(--text); background: transparent;
  border-radius: 5px; padding: 1px 5px; line-height: 1.45; transition: background .1s;
}
.cal-chip:hover { background: color-mix(in srgb, var(--c, var(--terracotta)) 14%, var(--mix-base)); }
.cal-chip__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c, var(--terracotta)); }
.cal-chip__time { flex: none; color: var(--text-muted); font-weight: 700; font-size: 10.5px; }
.cal-chip__t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip--allday { background: color-mix(in srgb, var(--c, var(--terracotta)) 22%, var(--mix-base)); color: color-mix(in srgb, var(--c, var(--terracotta)) 55%, var(--mix-ink)); font-weight: 700; }
.cal-chip--allday:hover { background: color-mix(in srgb, var(--c, var(--terracotta)) 32%, var(--mix-base)); }
.cal-chip--rem { color: var(--ink-soft); font-weight: 600; }
.cal-chip--rem svg { width: 11px; height: 11px; flex: none; color: var(--warm-grey); }
.cal-chip--rem:hover { background: var(--surface-2); }
.cal-chip--rem.is-done .cal-chip__t { text-decoration: line-through; color: var(--warm-grey); }
.cal-more { border: none; background: none; text-align: left; font-family: inherit; font-size: 11px; font-weight: 800; color: var(--terracotta-dk); padding: 0 5px; cursor: pointer; }
.cal-more:hover { text-decoration: underline; }

/* Vues semaine / jour (grille horaire) */
.cal-time { flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto; overflow-x: hidden; }
/* En-tête (jours + « Journée ») collé en haut : il défile avec la grille, donc les colonnes restent alignées */
.cal-time__sticky { position: sticky; top: 0; z-index: 5; background: var(--surface); }
.cal-layout--full { grid-template-columns: minmax(0, 1fr); }
.cal-layout--full .cal-aside { display: none; }
.cal-time__head, .cal-time__allday, .cal-time__grid { display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(0, 1fr)); }
.cal-time__head { border-bottom: 1px solid var(--border); }
.cal-time__corner { font-size: 10.5px; font-weight: 800; color: var(--warm-grey); display: grid; place-items: center; text-transform: uppercase; letter-spacing: .5px; }
.cal-time__day { border: none; background: none; font-family: inherit; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; border-left: 1px solid var(--border); }
.cal-time__day span { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-grey); }
.cal-time__day b { font-family: var(--font-display); font-size: 20px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.cal-time__day:hover b { background: var(--blush-soft); }
.cal-time__day.today span { color: var(--terracotta); }
.cal-time__day.today b { background: var(--terracotta); color: #fff; }
.cal-time--day .cal-time__day { flex-direction: row; justify-content: flex-start; gap: 10px; padding-left: 14px; cursor: default; }
.cal-time__allday { border-bottom: 1px solid var(--border); min-height: 34px; }
.cal-time__allcell { border-left: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.cal-time__allcell:hover { background: var(--cream); }
.cal-time__grid { position: relative; }
.cal-time__hours span { display: block; height: var(--hour); font-size: 10.5px; font-weight: 700; color: var(--warm-grey); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.cal-time__hours span:first-child { transform: none; }
.cal-daycol { position: relative; border-left: 1px solid var(--border); cursor: pointer; }
.cal-daycol.today { background: var(--cal-today); }
.cal-slot { height: var(--hour); border-bottom: 1px solid var(--border); }
.cal-slot:hover { background: color-mix(in srgb, var(--blush-soft) 35%, transparent); }
.cal-ev {
  position: absolute; z-index: 1; overflow: hidden; text-align: left; cursor: pointer; font-family: inherit;
  border: none; border-left: 3px solid var(--c); border-radius: 0 7px 7px 0; padding: 3px 6px;
  background: color-mix(in srgb, var(--c) 20%, var(--mix-base)); color: color-mix(in srgb, var(--c) 50%, var(--mix-ink));
  display: flex; flex-direction: column; gap: 0; transition: background .1s;
}
.cal-ev:hover { background: color-mix(in srgb, var(--c) 30%, var(--mix-base)); z-index: 2; }
.cal-ev b { font-size: 12px; font-weight: 800; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: break-word; hyphens: auto; }
.cal-ev.is-narrow { padding: 2px 4px; }
.cal-ev.is-narrow b { font-size: 11px; -webkit-line-clamp: 4; }
.cal-ev.is-narrow span { display: none; }
.cal-ev span { font-size: 11px; opacity: .85; }
.cal-ev.is-short { flex-direction: row; align-items: center; gap: 6px; }
.cal-ev.is-short b { -webkit-line-clamp: 1; }
.cal-ev.is-short span { display: none; }
.cal-remline {
  position: absolute; left: 2px; right: 2px; z-index: 1; display: flex; align-items: center; gap: 4px; height: 20px; margin-top: -10px;
  border: 1px dashed var(--nude); background: var(--surface); border-radius: 99px; padding: 0 8px; font-family: inherit; font-size: 11px; font-weight: 700;
  color: var(--ink-soft); cursor: pointer; overflow: hidden; white-space: nowrap;
}
.cal-remline svg { width: 11px; height: 11px; flex: none; color: var(--terracotta); }
.cal-remline span { overflow: hidden; text-overflow: ellipsis; }
.cal-remline.is-done { opacity: .5; text-decoration: line-through; }
.cal-now { position: absolute; left: 0; right: 0; z-index: 3; height: 2px; background: var(--danger); pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }

/* Panneau agenda */
.agenda { padding: 12px 12px 8px; }
.agenda__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.agenda__head h3 { margin: 0 !important; text-transform: none !important; letter-spacing: 0 !important; font-family: var(--font-display) !important; font-size: 17px !important; color: var(--text) !important; }
.agenda__item, .agenda__next {
  display: flex; align-items: stretch; gap: 9px; width: 100%; border: none; background: none; text-align: left; font-family: inherit;
  padding: 7px 6px; margin: 0 -6px 2px; border-radius: 8px; cursor: pointer;
}
.agenda__item:hover, .agenda__next:hover { background: var(--surface-2); }
.agenda__time { flex: none; width: 44px; font-size: 12px; font-weight: 800; color: var(--ink-soft); display: flex; flex-direction: column; }
.agenda__time small { font-size: 11px; font-weight: 600; color: var(--warm-grey); }
.agenda__bar { width: 3px; border-radius: 3px; background: var(--c, var(--nude)); flex: none; }
.agenda__item--rem .agenda__bar { background: repeating-linear-gradient(180deg, var(--nude) 0 3px, transparent 3px 6px); }
.agenda__txt { min-width: 0; display: flex; flex-direction: column; }
.agenda__txt b { font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda__txt b svg { width: 12px; height: 12px; flex: none; color: var(--terracotta); }
.agenda__txt b i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.agenda__txt small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda__item--rem.is-done b { text-decoration: line-through; color: var(--warm-grey); }
.agenda__date { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--blush-soft); color: var(--terracotta-dk); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.agenda__date b { font-family: var(--font-display); font-size: 16px; }
.agenda__date small { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.agenda .goal-panel__empty .linkbtn { display: inline-flex; vertical-align: middle; }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr) 240px; }
}
@media (max-width: 900px) {
  .cal-main { overflow-y: auto; }
  .cal-layout { display: block; }
  .cal { min-height: 0; }
  .cal-time { flex: none; height: max(440px, calc(var(--app-h) - 150px)); }
  .cal-grid--month { flex: none; }
  .cal-aside { border-left: none; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 760px) {
  .cal-bar { padding: 12px 14px 10px; }
  .cal-label { font-size: 21px; flex-basis: 100%; }
  .cal-bar__right { width: 100%; }
  .cal-bar__right .btn-primary { margin-left: auto; }
  .cal-bar .cal-toggle > span:last-child { display: none; }
  .cal { padding: 10px; min-height: 0; }
  .cal-weeks { grid-template-rows: repeat(var(--weeks), 58px); }
  .cal-cell { padding: 3px; align-items: center; }
  .cal-cell__top { justify-content: center; }
  .cal-cell__add, .cal-cell__events { display: none; }
  .cal-cell__dots { display: flex; gap: 3px; justify-content: center; margin-top: 2px; }
  .cal-cell__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--terracotta); }
  .cal-cell__dots i.is-rem { background: none; border: 1.5px solid var(--nude); width: 6px; height: 6px; box-sizing: border-box; }
  .cal-time { height: max(420px, calc(var(--app-h) - 170px)); flex: none; }
  .cal-aside { grid-template-columns: 1fr; padding: 10px; }
  .seg { padding: 6px 10px; }
}

/* ---------- Focus (minuteur Pomodoro) ---------- */
.rail__timer {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); z-index: 2;
  background: var(--surface); color: var(--terracotta-dk); font-size: 9.5px; font-weight: 800; line-height: 1;
  padding: 2px 4px; border-radius: 6px; font-variant-numeric: tabular-nums; pointer-events: none;
}
.rail__timer[hidden] { display: none; }
.rail__timer.is-break { color: var(--ok-ink); }
.rail__timer.is-paused { opacity: .7; }

.focus-main { background: linear-gradient(160deg, var(--blush-soft) 0%, var(--cream) 45%, var(--offwhite) 100%); }
.focus-layout { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.focus-stage {
  --focus-c: var(--terracotta);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 40px 24px; min-height: var(--app-h); text-align: center;
}
.focus-stage:fullscreen { background: linear-gradient(160deg, var(--blush-soft) 0%, var(--cream) 50%, var(--offwhite) 100%); }
.focus-stage:fullscreen .focus-ring { width: min(440px, 70vmin); }
/* Plein écran (aussi sur iPhone) : le minuteur recouvre toute l'appli */
.focus-fs-exit { display: none; }
.focus-stage.is-fs {
  position: fixed; inset: 0; z-index: 90; min-height: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(160deg, var(--blush-soft) 0%, var(--cream) 50%, var(--offwhite) 100%);
}
.focus-stage.is-fs .focus-ring { width: min(440px, 78vmin); }
.focus-stage.is-fs .focus-fs-exit {
  display: grid; place-items: center; position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.focus-stage.is-fs #focus-full, .focus-stage.is-fs .focus-hint { display: none; }
body.focus-fs-on { overflow: hidden; }

.focus-modes { display: inline-flex; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--border); border-radius: 99px; padding: 3px; }
.focus-mode {
  border: none; background: none; border-radius: 99px; padding: 7px 16px; font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s;
}
.focus-mode:hover { color: var(--text); }
.focus-mode.active { background: var(--focus-c); color: #fff; }

.focus-ring { position: relative; width: min(320px, 72vw); aspect-ratio: 1; }
.focus-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-ring__bg { fill: color-mix(in srgb, var(--surface) 75%, transparent); stroke: var(--border-strong); stroke-width: 8; }
.focus-ring__fg { fill: none; stroke: var(--focus-c); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .3s linear, stroke .3s; }
.focus-ring__inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.focus-ring__mode { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--focus-c); }
.focus-ring__time { font-family: var(--font-display); font-size: clamp(48px, 13vw, 76px); font-weight: 600; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.focus-ring__cycle { display: flex; gap: 6px; margin-top: 4px; }
.focus-ring__cycle i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--nude); }
.focus-ring__cycle i.on { background: var(--terracotta); border-color: var(--terracotta); }
.focus-ring__cycle i.cur { border-color: var(--terracotta); }
.focus-stage.is-running .focus-ring__cycle i.cur { animation: focusPulse 1.6s ease-in-out infinite; }
@keyframes focusPulse { 50% { background: var(--blush); } }

.focus-task {
  width: min(360px, 100%); border: none; border-bottom: 1.5px dashed var(--border-strong); background: transparent; outline: none;
  text-align: center; font-family: inherit; font-size: 16px; font-weight: 600; color: var(--text); padding: 6px 4px;
}
.focus-task::placeholder { color: var(--warm-grey); font-weight: 400; }
.focus-task:focus { border-bottom-color: var(--nude); border-bottom-style: solid; }

.focus-controls { display: flex; align-items: center; gap: 16px; }
.focus-ctl {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer; transition: border-color .12s, color .12s;
}
.focus-ctl:hover { border-color: var(--nude); color: var(--terracotta-dk); }
.focus-play {
  display: inline-flex; align-items: center; gap: 10px; height: 60px; padding: 0 30px 0 26px; border: none; border-radius: 99px;
  background: var(--focus-c); color: #fff; font-family: inherit; font-size: 17px; font-weight: 800; cursor: pointer; min-width: 180px; justify-content: center;
  transition: filter .12s;
}
.focus-play:hover { filter: brightness(.95); }
.focus-play svg { fill: currentColor; stroke: none; }

.focus-extras { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.focus-extras #focus-vol { width: 90px; accent-color: var(--terracotta); }
.focus-hint { margin: 0; font-size: 12px; color: var(--warm-grey); }

.focus-aside { border-left: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, transparent); padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.goal-stats.focus-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.focus-stats .goal-stat { padding: 10px; }
.focus-stats .goal-stat b { font-size: 18px; white-space: nowrap; }
.focus-stats .goal-stat__ic { margin-bottom: 6px; }
.focus-week__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.focus-week__head h3 { margin: 0 !important; }
.focus-week__head b { font-size: 13px; color: var(--terracotta-dk); }
.focus-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 110px; }
.focus-week__col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.focus-week__bar { flex: 1; width: 100%; max-width: 22px; background: var(--surface-2); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.focus-week__bar i { display: block; width: 100%; background: var(--nude); border-radius: 6px; transition: height .4s var(--ease); }
.focus-week__col.today .focus-week__bar i { background: var(--terracotta); }
.focus-week__col small { font-size: 11px; font-weight: 800; color: var(--warm-grey); }
.focus-week__col.today small { color: var(--terracotta-dk); }
.focus-log { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.focus-log:last-of-type { border-bottom: none; }
.focus-log__time { flex: none; font-size: 12px; font-weight: 800; color: var(--ink-soft); width: 40px; }
.focus-log__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.focus-log__txt b { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-log__txt small { font-size: 12px; color: var(--text-muted); }
.focus-log__del { opacity: 0; }
.focus-log:hover .focus-log__del { opacity: 1; }
.focus-note { font-size: 12px; color: var(--warm-grey); margin: 10px 0 0; line-height: 1.5; }
.focus-cfg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.focus-cfg label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.focus-cfg small { font-weight: 400; color: var(--warm-grey); }


/* Focus v2 : finitions */
.focus-mode { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
@media (max-width: 600px) { .focus-mode small { display: none; } }
.focus-mode small { font-size: 11px; font-weight: 700; opacity: .65; }
.focus-ring__ticks line { stroke: var(--soft-grey); stroke-width: 1; stroke-linecap: round; }
.focus-ring__ticks line.long { stroke: var(--warm-grey); stroke-width: 1.6; }
.focus-ring__head { fill: var(--surface); stroke: var(--focus-c); stroke-width: 4; transition: opacity .2s; }
.focus-ring__end { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.focus-stage.is-running .focus-ring__end { color: var(--focus-c); }

.focus-taskbox { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(420px, 100%); }
.focus-task-wrap {
  display: flex; align-items: center; gap: 8px; width: 100%; background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border-strong); border-radius: 99px; padding: 0 16px; color: var(--warm-grey);
}
.focus-task-wrap:focus-within { border-color: var(--nude); box-shadow: var(--ring); }
.focus-task-wrap .focus-task { border: none; width: 100%; padding: 11px 0; text-align: left; }
.focus-task-wrap .focus-task:focus { border: none; }
.focus-sugg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.focus-sugg__chip {
  border: 1px dashed var(--border-strong); background: transparent; border-radius: 99px; padding: 4px 11px; max-width: 200px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s, border-color .12s, color .12s;
}
.focus-sugg__chip:hover { border-color: var(--nude); color: var(--text); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.focus-sugg__chip.sel { border-style: solid; border-color: var(--nude); background: var(--blush-soft); color: var(--terracotta-dk); }
.focus-tip {
  margin: -6px 0 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px;
  background: color-mix(in srgb, var(--focus-c) 16%, var(--mix-base)); color: color-mix(in srgb, var(--focus-c) 60%, var(--mix-ink)); font-size: 14px; font-weight: 700;
}
.focus-tip[hidden] { display: none; }

.focus-controls { align-items: flex-start; }
.focus-ctl { position: relative; margin-bottom: 18px; }
.focus-ctl small { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--warm-grey); white-space: nowrap; }
.focus-play { margin-top: -6px; }

.focus-goal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.focus-goal__head h3 { margin: 0 !important; }
.focus-goal__head .linkbtn { font-size: 12px; }
.focus-goal__val { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.focus-goal__val b { font-family: var(--font-display); font-size: 26px; color: var(--text); }
.focus-goal__val span { font-size: 13px; color: var(--text-muted); font-weight: 700; }
.focus-goal__bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.focus-goal__bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--nude), var(--terracotta)); transition: width .5s var(--ease); }
.focus-goal.is-done .focus-goal__bar span { background: linear-gradient(90deg, #AFCDA8, #8FB996); }
.focus-goal__msg { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.focus-cfg__wide { grid-column: 1 / -1; }
@media (max-width: 980px) {
  .focus-layout { grid-template-columns: 1fr; }
  .focus-stage { min-height: auto; padding: 32px 18px 24px; }
  .focus-aside { border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .focus-mode { padding: 6px 11px; font-size: 12.5px; }
  .focus-play { min-width: 150px; height: 54px; padding: 0 22px; }
  .focus-log__del { opacity: 1; }
}

/* ---------- Page Profil ---------- */
.rail__avatar.active { border-color: var(--blush); box-shadow: 0 0 0 2px var(--terracotta); }
.profile-modal { max-height: 90vh; overflow-y: auto; }
.status-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.status-kind {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px;
  padding: 4px 11px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.status-kind i { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.status-kind.sel { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 16%, var(--mix-base)); color: var(--text); }
.pf-links { display: flex; flex-direction: column; gap: 6px; }

.pp { max-width: 960px; margin: 0 auto; padding: 22px 28px 90px; }
.pp-tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 99px; padding: 3px; margin-bottom: 18px; }
.pp-tab { border: none; background: none; border-radius: 99px; padding: 7px 18px; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.pp-tab:hover { color: var(--text); }
.pp-tab.active { background: var(--surface); color: var(--terracotta-dk); }

.pp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 26px; }
.pp-banner { height: 170px; background: linear-gradient(125deg, var(--blush) 0%, var(--nude) 55%, var(--terracotta) 100%); background-size: cover; background-position: center; }
.pp-head { display: flex; align-items: flex-start; gap: 18px; padding: 0 24px; margin-top: -52px; flex-wrap: wrap; }
.pp-avatar { position: relative; flex: none; }
.pp-avatar .avatar { border: 5px solid var(--surface); font-size: 38px !important; }
.pp-dot { position: absolute; right: 8px; bottom: 8px; width: 20px; height: 20px; border-radius: 50%; border: 4px solid var(--surface); }
.pp-id { flex: 1; min-width: 200px; margin-top: 62px; }
.pp-id h1 { font-size: 28px; }
.pp-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.pp-status__kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 12.5px; color: var(--text); background: color-mix(in srgb, var(--sc) 18%, var(--mix-base)); border-radius: 99px; padding: 3px 10px; }
.pp-status__kind i { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); }
.pp-edit { margin-top: 64px; }
.pp-about { padding: 14px 24px 22px; }
.pp-bio { margin: 0 0 12px; font-size: 15px; line-height: 1.65; color: var(--text); max-width: 640px; white-space: pre-wrap; }
.pp-bio--empty { color: var(--warm-grey); font-style: italic; }
.pp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; color: var(--text-muted); }
.pp-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.pp-link { display: inline-flex; align-items: center; gap: 6px; color: var(--terracotta-dk); font-weight: 700; border: 1px solid var(--border-strong); border-radius: 99px; padding: 3px 11px; }
.pp-link:hover { border-color: var(--nude); background: var(--blush-soft); }

.pp-h2 { font-family: var(--font-body); font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); margin: 0 0 12px; }
.pp-h2row { display: flex; align-items: baseline; justify-content: space-between; }
.pp-count { font-size: 12.5px; font-weight: 700; color: var(--terracotta-dk); }
.pp-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 28px; }
.pp-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; min-width: 0; }
.pp-stat__ic { width: 30px; height: 30px; border-radius: 9px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; margin-bottom: 8px; }
.pp-stat__ic svg { width: 17px; height: 17px; }
.pp-stat b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; color: var(--text); white-space: nowrap; }
.pp-stat b small { font-size: 14px; color: var(--warm-grey); }
.pp-stat > span:last-child { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.pp-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pp-badge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.pp-badge__ic { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; background: var(--surface-2); color: var(--soft-grey); border: 2px dashed var(--border-strong); }
.pp-badge b { font-size: 13.5px; color: var(--ink-soft); }
.pp-badge small { font-size: 11.5px; color: var(--warm-grey); line-height: 1.35; min-height: 31px; }
.pp-badge__prog { width: 80%; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.pp-badge__prog i { display: block; height: 100%; background: var(--nude); border-radius: 99px; }
.pp-badge__num { font-size: 11px; font-weight: 800; color: var(--warm-grey); }
.pp-badge.is-ok .pp-badge__ic { background: linear-gradient(135deg, var(--blush-soft), var(--blush)); color: var(--terracotta-dk); border: 2px solid var(--nude); }
.pp-badge.is-ok b { color: var(--text); }
.pp-badge__ok { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11.5px; font-weight: 800; color: #5f9e77; }
.pp-badge__ok svg { width: 12px; height: 12px; }

.pp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.pp-panel--danger { border-color: var(--danger-line); }
.pp-panel--danger .pp-h2 { color: var(--danger); }
.pp-panel--danger .pp-help { margin: 0 0 12px; }
.pp-rows { display: flex; flex-direction: column; }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--ink-soft); }
.pp-row:first-child, .pp-h2 + .pp-row { border-top: none; padding-top: 0; }
.pp-row b { color: var(--text); text-align: right; word-break: break-all; }
.pp-row--ctl { cursor: default; }
label.pp-row--ctl { cursor: pointer; }
.pp-form { display: flex; gap: 10px; flex-wrap: wrap; }
.pp-form .input { flex: 1; min-width: 220px; }
.pp-form--col { flex-direction: column; max-width: 420px; }
.pp-form--col .btn { align-self: flex-start; }
.pp-help { font-size: 12.5px; color: var(--warm-grey); margin: 8px 0 0; }
.pp-error { margin: 0; font-size: 13px; color: var(--danger); font-weight: 600; }
.pp-error[hidden] { display: none; }
.pp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pp-ok { display: inline-flex; align-items: center; gap: 5px; color: #5f9e77; font-size: 13px; }
.pp-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.pp-mod { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--warm-grey); transition: border-color .12s, background .12s, color .12s; }
.pp-mod input { display: none; }
.pp-mod__ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); }
.pp-mod__ic svg { width: 16px; height: 16px; }
.pp-mod.on { border-color: var(--nude); background: var(--blush-soft); color: var(--text); }
.pp-mod.on .pp-mod__ic { background: var(--surface); color: var(--terracotta); }

@media (max-width: 860px) {
  .pp-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .pp { padding: 16px 14px 80px; }
  .pp-head { padding: 0 16px; }
  .pp-about { padding: 12px 16px 18px; }
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
  .pp-edit { width: 100%; margin-top: 4px; }
  .pp-id { margin-top: 8px; flex-basis: 100%; }
  .pp-badges { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Explorer (inspiré de Pinterest) ---------- */
.topbar-pub { font-size: 12.5px; }
.topbar-pub svg { width: 15px; height: 15px; }
.ex-main { background: var(--bg); }

/* Barre de recherche collante */
.ex-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px);
}
.ex-searchwrap { position: relative; flex: 1; max-width: 900px; margin: 0 auto; }
.ex-search {
  display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px 0 18px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--border); color: var(--warm-grey); transition: border-color .12s, background .12s;
}
.ex-search:focus-within { background: var(--surface); border-color: var(--nude); }
.ex-search input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: inherit; font-size: 15.5px; color: var(--text); }
.ex-search__clear { border: none; background: var(--border); color: var(--ink-soft); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.ex-search__clear svg { width: 12px; height: 12px; }
.ex-search__clear[hidden] { display: none; }
.ex-pub {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 20px 0 16px; border: none; border-radius: 99px;
  background: var(--terracotta); color: #fff; font-family: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer;
}
.ex-pub:hover { background: var(--terracotta-dk); }
/* Suggestions sous la recherche */
.ex-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; background: var(--surface); border-radius: 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 18px 22px 20px; max-height: 70vh; overflow-y: auto;
  animation: pop .18s var(--ease);
}
.ex-suggest[hidden] { display: none; }
.ex-sug__sec + .ex-sug__sec { margin-top: 18px; }
.ex-sug__sec h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; color: var(--text); }
.ex-sug__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-sug__chip { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 99px; }
.ex-sug__chip button { border: none; background: none; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); padding: 7px 4px 7px 14px; cursor: pointer; }
.ex-sug__chip .ex-sug__x { padding: 7px 10px 7px 4px; color: var(--warm-grey); display: grid; place-items: center; }
.ex-sug__x svg { width: 12px; height: 12px; }
.ex-sug__tag { border: none; background: var(--blush-soft); color: var(--terracotta-dk); border-radius: 99px; padding: 7px 14px; font-family: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.ex-sug__tag:hover { background: var(--blush); }
.ex-sug__cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ex-sug__cat {
  display: flex; align-items: center; gap: 10px; border: none; border-radius: 16px; padding: 12px; font-family: inherit; font-size: 13.5px; font-weight: 800;
  background: color-mix(in srgb, var(--cc) 22%, var(--mix-base)); color: color-mix(in srgb, var(--cc) 50%, var(--mix-ink)); cursor: pointer; text-align: left;
}
.ex-sug__cat span { width: 34px; height: 34px; border-radius: 11px; background: color-mix(in srgb, var(--surface) 75%, transparent); display: grid; place-items: center; flex: none; }
.ex-sug__cat:hover { background: color-mix(in srgb, var(--cc) 34%, var(--mix-base)); }

/* Onglets */
.ex-nav { display: flex; justify-content: safe center; gap: 6px; padding: 2px 16px 10px; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.ex-nav::-webkit-scrollbar { display: none; }
.ex-navbtn { flex: none; white-space: nowrap; border: none; background: none; border-radius: 99px; padding: 10px 16px; font-family: inherit; font-size: 15px; font-weight: 800; color: var(--text); cursor: pointer; }
.ex-navbtn:hover { background: var(--surface-2); }
.ex-navbtn.active { background: var(--solid); color: #fff; }

.ex-body { padding: 6px 20px 90px; max-width: 1640px; margin: 0 auto; }
.ex-chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 4px 14px; scrollbar-width: none; justify-content: safe center; }
.ex-chips::-webkit-scrollbar { display: none; }
.ex-chip, .pub-cats .ex-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 16px; padding: 9px 14px;
  background: var(--surface-2); font-family: inherit; font-size: 13.5px; font-weight: 800; color: var(--text); cursor: pointer; transition: background .12s, color .12s;
}
.ex-chip svg { color: var(--cc, var(--terracotta)); }
.ex-chip:hover { background: color-mix(in srgb, var(--cc, var(--nude)) 22%, var(--mix-base)); }
.ex-chip.active { background: var(--solid); color: #fff; }
.ex-chip.active svg { color: #fff; }
.pub-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-filterline { display: flex; align-items: center; justify-content: center; gap: 10px; margin: -4px 0 14px; font-size: 14px; color: var(--ink-soft); }
.ex-pagehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px auto 20px; max-width: 1200px; }
.ex-pagehead > div { flex: 1; min-width: 200px; }
.ex-pagehead h1 { font-size: clamp(26px, 3.4vw, 34px); }
.ex-pagehead p { margin: 4px 0 0; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-size: 14px; }
.ex-back, .ex-roundbtn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.ex-back:hover, .ex-roundbtn:hover { background: var(--border); }
.ex-author { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin: 10px 0 26px; }
.ex-author .ex-back { position: absolute; left: 0; top: 0; }
.ex-author h1 { font-size: 30px; margin-top: 6px; }
.ex-author p { margin: 0; color: var(--text-muted); font-weight: 700; }
.ex-loading { display: grid; place-items: center; padding: 60px 0; grid-column: 1 / -1; }
.ex-empty { text-align: center; padding: 50px 20px; grid-column: 1 / -1; }
.ex-empty img { width: 70px; opacity: .8; margin: 0 auto 12px; }
.ex-empty h3 { font-size: 22px; margin-bottom: 6px; }
.ex-empty p { color: var(--text-muted); margin: 0 auto 18px; max-width: 420px; }
.ex-sentinel { min-height: 40px; display: grid; place-items: center; padding: 10px 0 30px; }
.ex-end { display: inline-flex; align-items: center; gap: 8px; color: var(--warm-grey); font-size: 13.5px; font-weight: 700; margin: 0; }
.ex-end svg { color: var(--nude); }

/* Grille en colonnes équilibrées */
.masonry { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 16px; align-items: start; }
.masonry__col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Épingle */
.pin { cursor: zoom-in; min-width: 0; }
.pin__media { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.pin__img { position: relative; background: linear-gradient(135deg, var(--blush-soft), var(--offwhite)); min-height: 120px; }
.pin__img img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.pin__img.is-loaded img { opacity: 1; }
.pin__count { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); border-radius: 99px; padding: 3px 9px; font-size: 11.5px; font-weight: 800; }
.pin__count svg { width: 12px; height: 12px; }
.pin__paper {
  padding: 16px 16px 18px 18px; min-height: 160px;
  background: repeating-linear-gradient(180deg, var(--surface) 0 25px, var(--border) 25px 26px); border-left: 5px solid var(--cc);
}
.pin__paper-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: color-mix(in srgb, var(--cc) 55%, var(--mix-ink)); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.pin__paper b { display: block; font-family: var(--font-display); font-size: 19px; line-height: 1.25; color: var(--text); margin-bottom: 4px; }
.pin__paper p { margin: 0; font-size: 13px; line-height: 26px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.pin__codewrap { background: #2B2624; padding: 12px 14px 14px; }
.pin__codewrap .codebox__dots { margin-bottom: 8px; display: flex; }
.pin__code { margin: 0; color: #EDE3DC; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px; line-height: 1.6; max-height: 190px; overflow: hidden; white-space: pre; }
.pin__code code.hljs { background: none; padding: 0; }
.pin__pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 30px 16px 22px; background: color-mix(in srgb, var(--cc) 18%, var(--mix-base)); }
.pin__pdf-page { position: relative; width: 96px; height: 124px; border-radius: 6px 22px 6px 6px; background: var(--surface); box-shadow: 0 1px 0 rgba(0,0,0,.04); display: flex; flex-direction: column; gap: 7px; padding: 34px 14px 0; }
.pin__pdf-page b { position: absolute; top: 10px; left: 12px; font-size: 12px; font-weight: 900; letter-spacing: 1px; color: #fff; background: var(--terracotta); border-radius: 4px; padding: 1px 6px; }
.pin__pdf-page i { display: block; height: 5px; border-radius: 3px; background: var(--surface-2); }
.pin__pdf-page i:nth-child(3) { width: 75%; }
.pin__pdf-page i:nth-child(5) { width: 55%; }
.pin__pdf small { font-size: 12px; color: var(--ink-soft); text-align: center; word-break: break-word; font-weight: 700; }

/* Survol : voile + boutons (comme Pinterest) */
.pin__over {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 12px;
  background: rgba(33,26,24,.38); opacity: 0; transition: opacity .15s;
}
.pin:hover .pin__over, .pin:focus-within .pin__over { opacity: 1; }
.pin__over { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr auto; }
.pin__board {
  grid-column: 1; grid-row: 1; justify-self: start; max-width: 100%; display: inline-flex; align-items: center; gap: 4px; border: none;
  background: none; color: #fff; font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer; padding: 6px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.pin__board svg { flex: none; }
.pin__save {
  grid-column: 2; grid-row: 1; border: none; border-radius: 99px; padding: 11px 16px; font-family: inherit; font-size: 14px; font-weight: 800;
  background: var(--terracotta); color: #fff; cursor: pointer;
}
.pin__save:hover { background: var(--terracotta-dk); }
.pin__save.is-on { background: var(--solid); }
.pin__tools { grid-column: 1 / -1; grid-row: 3; justify-self: end; display: flex; gap: 8px; }
.pin__tool { width: 34px; height: 34px; border-radius: 50%; border: none; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.pin__tool:hover { background: var(--surface); }
.pin__tool svg { width: 16px; height: 16px; }
.pin.is-saved:not(:hover) .pin__media::after { content: ""; position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--terracotta); border: 2px solid var(--surface); }
.pin__title { font-family: var(--font-body); font-size: 14px; font-weight: 800; color: var(--text); margin: 8px 4px 0; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 2px 0; }
.pin__author { display: inline-flex; align-items: center; gap: 7px; min-width: 0; border: none; background: none; padding: 2px; border-radius: 99px; font-family: inherit; font-size: 12.5px; color: var(--ink-soft); font-weight: 700; cursor: pointer; }
.pin__author:hover span { text-decoration: underline; }
.pin__author > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin__stats { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--warm-grey); }
.pin__stats svg { width: 13px; height: 13px; margin-left: 4px; }

/* Choix du tableau */
.board-pop { width: 290px; padding: 12px; border-radius: 20px; }
.board-pop__title { margin: 4px 6px 10px; text-align: center; font-weight: 800; font-size: 15px; }
.board-pop__search { border-radius: 99px; margin-bottom: 8px; }
.board-pop__list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.board-pop__it { display: flex !important; align-items: center; gap: 10px; border-radius: 12px !important; padding: 7px 8px !important; }
.board-pop__it span:not(.board-thumb) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.board-pop__it svg { color: var(--terracotta); }
.board-pop__it.sel { background: var(--blush-soft); }
.board-thumb { width: 40px; height: 40px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--warm-grey); }
.board-thumb img { width: 100%; height: 100%; object-fit: cover; }
.board-pop__new { display: flex !important; align-items: center; gap: 10px; margin-top: 6px; border-top: 1px solid var(--border) !important; border-radius: 0 0 12px 12px !important; padding-top: 12px !important; font-weight: 800 !important; }
.board-pop__new svg { width: 40px; height: 40px; padding: 10px; border-radius: 10px; background: var(--surface-2); }

/* Mes tableaux */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 18px; max-width: 1200px; margin: 0 auto; }
.xboard { border: none; background: none; text-align: left; font-family: inherit; cursor: pointer; padding: 0; }
.xboard__cover { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 1.5; border-radius: 18px; overflow: hidden; margin-bottom: 8px; }
.xboard__cover i { background: var(--surface-2) center/cover no-repeat; }
.xboard__cover i:first-child { grid-row: span 2; background-color: var(--blush-soft); }
.xboard:hover .xboard__cover { filter: brightness(.93); }
.xboard b { display: block; font-size: 16px; color: var(--text); }
.xboard small { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

/* Gros plan */
.modal.pd-modal { max-width: 1060px; width: 100%; padding: 0; overflow: hidden; position: relative; max-height: 94vh; border-radius: 32px; background: var(--offwhite); }
.pd-x { position: absolute; top: 14px; right: 14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.pd-scroll { max-height: 94vh; overflow-y: auto; padding: 18px; }
.pd { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr); background: var(--surface); border-radius: 28px; overflow: hidden; min-height: 420px; }
.pd__content { background: var(--cream); min-height: 300px; max-height: 80vh; overflow-y: auto; display: flex; }
.pd__content > * { flex: 1; min-width: 0; }
.pd__side { padding: 22px 26px 18px; display: flex; flex-direction: column; gap: 12px; max-height: 80vh; overflow-y: auto; }
.pd__bar { display: flex; align-items: center; gap: 6px; position: sticky; top: -22px; background: var(--surface); padding: 8px 0; margin-top: -8px; z-index: 2; padding-right: 44px; }
.pd__spacer { flex: 1; }
.pd-round { width: 44px; height: 44px; border-radius: 50%; border: none; background: none; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.pd-round:hover { background: var(--surface-2); }
.pd-board { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; font-family: inherit; font-size: 14.5px; font-weight: 800; color: var(--text); cursor: pointer; padding: 8px 10px; border-radius: 12px; max-width: 170px; }
.pd-board span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-board:hover { background: var(--surface-2); }
.pd-save { border: none; border-radius: 99px; padding: 12px 18px; font-family: inherit; font-size: 14.5px; font-weight: 800; background: var(--terracotta); color: #fff; cursor: pointer; }
.pd-save:hover { background: var(--terracotta-dk); }
.pd-save.is-on { background: var(--solid); }
.pd__side .pin__cat { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: color-mix(in srgb, var(--cc) 55%, var(--mix-ink)); background: color-mix(in srgb, var(--cc) 22%, var(--mix-base)); border-radius: 99px; padding: 3px 10px; }
.pd__title { font-size: clamp(24px, 3vw, 32px); margin: 0; line-height: 1.2; }
.pd__desc { margin: 0; color: var(--ink-soft); line-height: 1.6; white-space: pre-wrap; }
.pd__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd__tags button { border: none; background: none; padding: 0; font-family: inherit; font-size: 14px; font-weight: 800; color: var(--terracotta-dk); cursor: pointer; }
.pd__tags button:hover { text-decoration: underline; }
.pd__cta { display: flex; flex-wrap: wrap; gap: 8px; }
.pd__cta:empty { display: none; }
.pd__author { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.pd__who { display: flex; align-items: center; gap: 10px; border: none; background: none; padding: 0; font-family: inherit; text-align: left; cursor: pointer; min-width: 0; }
.pd__who b { display: block; font-size: 15px; color: var(--text); }
.pd__who small { font-size: 12.5px; color: var(--text-muted); }
.pd__who:hover b { text-decoration: underline; }
.pd-like { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--surface-2); border-radius: 99px; padding: 9px 14px; font-family: inherit; font-size: 14px; font-weight: 800; color: var(--ink-soft); cursor: pointer; }
.pd-like:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
.pd-like.is-on { color: var(--terracotta); background: var(--blush-soft); }
.pd-like.is-on svg { fill: currentColor; }
.pd__comments h3 { font-family: var(--font-body); font-size: 16px; font-weight: 800; margin: 0 0 10px; }
.pd__comments[hidden], .pd-cmt-form[hidden] { display: none; }
.pd-cmts { display: flex; flex-direction: column; gap: 12px; max-height: 260px; overflow-y: auto; }
.pd-cmt { display: flex; gap: 10px; align-items: flex-start; }
.pd-cmt__body p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); word-break: break-word; }
.pd-cmt__body small { font-size: 12px; color: var(--warm-grey); }
.pd-cmt__body .linkbtn { display: inline; padding: 0; font-size: 12px; }
.pd-cmt-empty { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.pd-cmt-form { display: flex; align-items: center; gap: 10px; position: sticky; bottom: -18px; background: var(--surface); padding: 12px 0 4px; border-top: 1px solid var(--border); margin-top: auto; }
.pd-cmt-form input { flex: 1; min-width: 0; height: 44px; border: none; border-radius: 99px; background: var(--surface-2); padding: 0 16px; font-family: inherit; font-size: 14px; outline: none; color: var(--text); }
.pd-cmt-form input:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--nude); }
.pd-send { width: 44px; height: 44px; flex: none; border-radius: 50%; border: none; background: var(--terracotta); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pd-note { padding: 30px 34px; }
.pd-note .ql-container.ql-snow { border: none !important; }
.pd-note .ql-editor { min-height: 0; padding: 0; }
.pd-gallery { display: flex; flex-direction: column; background: var(--surface-2); }
.pd-main { width: 100%; height: auto; max-height: 72vh; object-fit: contain; display: block; cursor: zoom-in; margin: auto; }
.pd-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; background: var(--surface); }
.pd-thumbs button { width: 58px; height: 58px; flex: none; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: none; }
.pd-thumbs button.sel { border-color: var(--terracotta); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd-code { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.pd-pre { margin: 0; padding: 14px 18px; overflow-x: auto; font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; line-height: 1.6; color: #EDE3DC; }
.pd-pre code.hljs { background: none; padding: 0; }
.pd-text { margin: 0; line-height: 1.7; white-space: pre-wrap; }
.pd-callout { white-space: pre-wrap; }
.pd-pdf { width: 100%; height: 78vh; border: none; display: block; }
.pd-more { padding: 26px 4px 6px; }
.pd-more > h3 { text-align: center; font-family: var(--font-body); font-size: 18px; font-weight: 800; margin: 0 0 16px; }
.pd-more[hidden] { display: none; }

/* Publier */
.modal.pub-modal { max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 28px; }
.modal.pub-modal:has(.has-drop) { max-width: 860px; }
.pub-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pub-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 18px; padding: 16px; font-family: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.pub-kind:hover { border-color: var(--nude); background: var(--cream); }
.pub-kind__ic { width: 40px; height: 40px; border-radius: 12px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; margin-bottom: 4px; }
.pub-kind b { font-size: 15px; color: var(--text); }
.pub-kind small { font-size: 12.5px; color: var(--text-muted); }
.pub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pub-head .btn-icon { font-size: 22px; }
.pub-layout.has-drop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; }
.pub-dropzone { display: block; cursor: pointer; }
.pub-dropzone__in {
  min-height: 340px; height: 100%; border-radius: 24px; background: var(--surface-2); border: 2px dashed var(--border-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 18px; transition: border-color .12s, background .12s;
}
.pub-dropzone:hover .pub-dropzone__in, .pub-dropzone.is-over .pub-dropzone__in { border-color: var(--nude); background: var(--blush-soft); }
.pub-dropzone__ic { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--terracotta); display: grid; place-items: center; }
.pub-dropzone__in b { font-size: 15px; color: var(--text); }
.pub-dropzone__in small { font-size: 12.5px; color: var(--text-muted); }
.pub-pdfprev { width: 70px; height: 90px; border-radius: 6px 16px 6px 6px; background: var(--surface); display: grid; place-items: center; font-weight: 900; color: var(--terracotta); letter-spacing: 1px; }
.pub-previews { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: 100%; align-self: stretch; }
.pub-prev { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface); }
.pub-prev img { width: 100%; height: 100%; object-fit: cover; }
.pub-prev button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: color-mix(in srgb, var(--surface) 92%, transparent); display: grid; place-items: center; cursor: pointer; }
.pub-prev button svg { width: 12px; height: 12px; }
.pub-prev--add { display: grid; place-items: center; color: var(--warm-grey); border: 2px dashed var(--border-strong); background: transparent; }

@media (max-width: 700px) {
  .ex-navbtn { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 860px) {
  .pd { grid-template-columns: 1fr; }
  .pd__content, .pd__side { max-height: none; }
  .pd__bar { top: 0; }
  .pub-layout.has-drop { grid-template-columns: 1fr; }
  .pub-dropzone__in { min-height: 200px; }
}
@media (max-width: 560px) {
  .ex-top { padding: 10px 12px; }
  .ex-pub span { display: none; }
  .ex-pub { width: 48px; padding: 0; justify-content: center; }
  .ex-navbtn { padding: 8px 11px; font-size: 13.5px; }
  .ex-body { padding: 4px 10px 80px; }
  .masonry, .masonry__col { gap: 10px; }
  .pin__over { opacity: 1; background: none; }
  .pin__over .pin__board, .pin__over .pin__tools { display: none; }
  .pin__save { padding: 7px 11px; font-size: 12px; }
  .pd-scroll { padding: 8px; }
  .modal.pd-modal { border-radius: 22px; }
  .pub-kinds { grid-template-columns: 1fr; }
  .topbar-pub span { display: none; }
}
/* ---------- Accueil ---------- */
.home-hero {
  position: relative; overflow: hidden; padding: 34px 28px 28px; border-bottom: 1px solid var(--border);
  background: linear-gradient(125deg, var(--blush-soft) 0%, var(--offwhite) 55%, var(--surface) 100%);
}
.home-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 260px; height: 260px; background: url("../img/logo-mark.png") center/contain no-repeat; opacity: .32; pointer-events: none; }
.home-hero__in { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; }
.home-hero h1 { font-size: clamp(30px, 4.4vw, 44px); margin: 6px 0 6px; }
.home-hero h1 em { font-style: italic; color: var(--terracotta-dk); }
.home-hero__sum { margin: 0; font-size: 16px; color: var(--ink-soft); }
.home-hero__quote { margin: 4px 0 0; font-style: italic; color: var(--terracotta-dk); font-size: 14px; }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.home-act {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 85%, transparent);
  border-radius: 99px; padding: 8px 16px 8px 12px; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.home-act svg { width: 17px; height: 17px; color: var(--terracotta); }
.home-act:hover { border-color: var(--nude); background: var(--surface); }

.home-grid {
  max-width: 1156px; margin: 0 auto; padding: 22px 28px 80px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start;
}
.home-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 16px; min-width: 0; }
.home-today { grid-column: span 7; grid-row: span 2; }
.home-focus { grid-column: span 5; }
.home-goals { grid-column: span 5; }
.home-notes { grid-column: span 7; }
.home-groups { grid-column: span 5; }
.home-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.home-card__head h2 { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 19px; }
.home-card__head h2 svg { width: 18px; height: 18px; color: var(--terracotta); }
.home-card__head .linkbtn svg { width: 12px; height: 12px; }
.home-empty { margin: 4px 0; font-size: 14px; color: var(--text-muted); }
.home-empty .linkbtn { display: inline-flex; vertical-align: middle; }

.home-overdue {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--danger-line); background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; text-align: left;
}
.home-overdue span { flex: 1; }
.home-agenda { display: flex; flex-direction: column; gap: 2px; }
.home-ag { display: flex; align-items: stretch; gap: 12px; width: 100%; border: none; background: none; text-align: left; font-family: inherit; padding: 9px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
button.home-ag:hover { background: var(--surface-2); }
.home-ag--rem { cursor: default; align-items: center; }
.home-ag__time { flex: none; width: 58px; font-size: 13px; font-weight: 800; color: var(--ink-soft); padding-top: 1px; }
.home-ag__bar { width: 4px; flex: none; border-radius: 4px; background: var(--c, var(--nude)); }
.home-ag__txt { min-width: 0; display: flex; flex-direction: column; }
.home-ag__txt b { font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-ag__txt small { font-size: 12px; color: var(--text-muted); }
.home-ag--rem.is-done .home-ag__txt b { text-decoration: line-through; color: var(--warm-grey); }
.home-check {
  width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: transparent;
  display: grid; place-items: center; cursor: pointer; padding: 0; margin: 0 -4px 0 -9px;
}
.home-check svg { width: 12px; height: 12px; }
.home-check:hover { border-color: var(--nude); color: var(--nude); }
.home-ag--rem.is-done .home-check { background: #8FB996; border-color: #8FB996; color: #fff; }
.home-add { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 6px 6px 12px; border: 1px dashed var(--border-strong); border-radius: 99px; color: var(--terracotta); }
.home-add:focus-within { border-style: solid; border-color: var(--nude); box-shadow: var(--ring); }
.home-add input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: inherit; font-size: 14px; color: var(--text); }
.home-add .btn { padding: 6px 14px; border-radius: 99px; }

.home-focus__body { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.home-ring { position: relative; width: 74px; height: 74px; flex: none; }
.home-ring svg { width: 74px; height: 74px; transform: rotate(-90deg); }
.home-ring .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.home-ring .ring-fg { fill: none; stroke: var(--terracotta); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.home-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--terracotta-dk); }
.home-focus__val { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.home-focus small { font-size: 12.5px; color: var(--text-muted); }
.home-live { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.home-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--soft-grey); }
.home-live.is-on { color: var(--terracotta-dk); }
.home-live.is-on i { background: var(--terracotta); animation: focusPulse 1.6s ease-in-out infinite; }

.home-goal { padding: 10px 0; border-top: 1px dashed var(--border); }
.home-goal:first-of-type { border-top: none; padding-top: 0; }
.home-goal__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.home-goal__top b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-goal__top span { font-size: 12.5px; font-weight: 800; color: var(--cat); }
.home-goal .goal-prog { margin-bottom: 6px; height: 6px; }
.home-step { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; padding: 4px 6px; margin: 0 -6px; border-radius: 7px; font-family: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; text-align: left; }
.home-step:hover { background: var(--surface-2); color: var(--text); }
.home-step .goal-step__box { margin-top: 0; }
.home-step.is-checking .goal-step__box { background: var(--cat); border-color: var(--cat); }

.home-note { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; text-align: left; font-family: inherit; padding: 8px 8px; margin: 0 -8px; border-radius: 10px; cursor: pointer; }
.home-note:hover { background: var(--surface-2); }
.home-note__ic { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.home-note__ic svg { width: 16px; height: 16px; }
.home-note__t { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-note small { flex: none; font-size: 12px; color: var(--warm-grey); }

@media (max-width: 980px) {
  .home-today, .home-focus, .home-goals, .home-notes, .home-groups { grid-column: span 12; grid-row: auto; }
  .home-focus { grid-column: span 6; }
  .home-goals { grid-column: span 6; }
}
@media (max-width: 680px) {
  .home-hero { padding: 26px 16px 22px; }
  .home-grid { padding: 16px 12px 80px; gap: 12px; }
  .home-focus, .home-goals { grid-column: span 12; }
  .home-act span { font-size: 13px; }
}

/* Accueil v2 : finitions */
.home-hero.is-evening { background: linear-gradient(125deg, #EFE3EC 0%, var(--offwhite) 55%, var(--surface) 100%); }
.home-hero { padding-bottom: 52px; }
/* Bande de chiffres qui chevauche le bas de l'en-tête */
.home-strip {
  position: relative; z-index: 2; max-width: 1100px; margin: -34px auto 0; padding: 0 28px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.home-kpi {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-family: inherit; cursor: pointer;
  transition: border-color .12s;
}
.home-kpi:hover { border-color: var(--nude); }
.home-kpi__ic { grid-row: span 2; width: 38px; height: 38px; border-radius: 11px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.home-kpi__ic svg { width: 19px; height: 19px; }
.home-kpi b { font-family: var(--font-display); font-size: 22px; line-height: 1.1; color: var(--text); white-space: nowrap; }
.home-kpi b i { font-style: normal; font-size: 14px; color: var(--warm-grey); }
.home-kpi small { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-kpi.is-alert .home-kpi__ic { background: var(--danger-soft); color: var(--danger); }
.home-kpi.is-alert small { color: var(--danger); }

/* Cartes : apparition douce en cascade */
.home-card { animation: homeIn .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes homeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Aujourd'hui */
.home-allday { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.home-pill {
  display: inline-flex; align-items: center; gap: 7px; border: none; font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  background: color-mix(in srgb, var(--c, var(--nude)) 20%, var(--mix-base)); color: color-mix(in srgb, var(--c, var(--terracotta)) 55%, var(--mix-ink));
  border-radius: 99px; padding: 5px 12px 5px 9px;
}
.home-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.home-pill--rem { background: var(--surface-2); color: var(--ink-soft); cursor: default; }
.home-pill--rem .home-check { width: 18px; height: 18px; margin: 0; }
.home-pill--rem.is-done { text-decoration: line-through; color: var(--warm-grey); }
.home-pill--rem.is-done .home-check { background: #8FB996; border-color: #8FB996; color: #fff; }
.home-ag.is-past { opacity: .5; }
.home-ag.is-past:hover { opacity: .85; }
.home-ag.is-now { background: color-mix(in srgb, var(--c) 10%, var(--mix-base)); }
.home-tag { display: inline-flex; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--c, var(--terracotta)); border-radius: 99px; padding: 1px 7px; margin-right: 6px; }
.home-in { font-weight: 800; color: var(--terracotta-dk); }
.home-ag__txt small { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.home-now { position: relative; display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.home-now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; margin-left: 52px; }
.home-now::after { content: ""; flex: 1; height: 2px; background: var(--danger); opacity: .5; border-radius: 2px; }
.home-now span { position: absolute; left: 0; font-size: 11px; font-weight: 800; color: var(--danger); }
.home-free { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--cream); border: 1px dashed var(--border-strong); color: var(--nude); }
.home-free svg { flex: none; width: 20px; height: 20px; }
.home-free b { display: block; font-size: 14px; color: var(--text); }
.home-free small { font-size: 12.5px; color: var(--text-muted); }
.home-free .linkbtn { padding: 2px 0; }
.home-tomorrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--ink-soft); }
.home-tomorrow__lbl { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-grey); }
.home-tomorrow__it { display: inline-flex; align-items: center; gap: 6px; }
.home-tomorrow__it i { width: 7px; height: 7px; border-radius: 50%; }

/* Focus : mini graphique de la semaine */
.home-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 54px; margin-bottom: 14px; }
.home-week__col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.home-week__col i { width: 100%; max-width: 18px; border-radius: 5px; background: var(--blush); }
.home-week__col.today i { background: var(--terracotta); }
.home-week__col small { font-size: 10.5px; font-weight: 800; color: var(--warm-grey); }
.home-week__col.today small { color: var(--terracotta-dk); }

/* Objectifs */
.home-goal__top { align-items: center; }
.home-goal__ic { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; color: var(--cat); background: color-mix(in srgb, var(--cat) 18%, var(--mix-base)); }
.home-goal__top b { flex: 1; }
.home-goal__top .goal-due { flex: none; }
.home-goal__prog { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.home-goal__prog .goal-prog { flex: 1; margin: 0; height: 6px; }
.home-goal__prog > span { font-size: 12px; font-weight: 800; color: var(--cat); min-width: 34px; text-align: right; }

/* Notes en petites cartes */
.home-notes__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.home-nc {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  border: 1px solid var(--border); background: var(--cream); border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.home-nc:hover { border-color: var(--nude); background: var(--surface); }
.home-nc__ic { grid-row: span 2; width: 30px; height: 30px; border-radius: 9px; background: var(--surface); color: var(--terracotta); display: grid; place-items: center; }
.home-nc__ic svg { width: 16px; height: 16px; }
.home-nc__t { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-nc small { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--warm-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-nc__pin { color: var(--terracotta); display: inline-flex; }
.home-nc__pin svg { width: 11px; height: 11px; }

/* À découvrir */
.home-explore { grid-column: span 7; }
.home-groups + .home-explore { grid-column: span 7; }
.home-disc { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.home-disc__it { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 8px; font-family: inherit; cursor: pointer; text-align: left; transition: border-color .12s; }
.home-disc__it:hover { border-color: var(--nude); }
.home-disc__thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 22%, var(--mix-base)); color: color-mix(in srgb, var(--cc) 55%, var(--mix-ink)); }
.home-disc__thumb img { width: 100%; height: 100%; object-fit: cover; }
.home-disc__thumb svg { width: 20px; height: 20px; }
.home-disc__txt { min-width: 0; display: flex; flex-direction: column; }
.home-disc__txt b { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-disc__txt small { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-explore[hidden] { display: none; }

@media (max-width: 980px) {
  .home-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-explore, .home-groups + .home-explore { grid-column: span 12; }
}
@media (max-width: 680px) {
  .home-strip { padding: 0 12px; gap: 8px; margin-top: -30px; }
  .home-kpi { padding: 10px; column-gap: 8px; }
  .home-kpi__ic { width: 32px; height: 32px; }
  .home-kpi b { font-size: 18px; }
  .home-notes__grid { grid-template-columns: 1fr; }
}

/* ---------- Travail de groupe v2 ---------- */
.grp-av { display: inline-grid; place-items: center; flex: none; border-radius: 30%; background: var(--gc); color: #fff; font-weight: 900; letter-spacing: .5px; text-shadow: 0 1px 1px rgba(0,0,0,.08); }
.grp-item { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; text-align: left; font-family: inherit; padding: 8px 10px; border-radius: 12px; cursor: pointer; transition: background .12s; }
.grp-item:hover { background: var(--blush-soft); }
.grp-item.active { background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.grp-item__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.grp-item__txt b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-item__txt small { font-size: 12px; color: var(--warm-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-item.has-unread .grp-item__txt b { font-weight: 900; }

.grp-topbar { gap: 12px; height: 64px; padding-top: 0; padding-bottom: 0; }
.grp-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.grp-head__txt { min-width: 0; display: flex; flex-direction: column; }
.grp-head__txt b { font-family: var(--font-display); font-size: 19px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-head__txt small { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-faces { display: flex; align-items: center; cursor: pointer; padding-left: 8px; }
.grp-faces .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.grp-faces__more { margin-left: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--surface); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.grp-invite {
  display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px;
  border: none; border-radius: 99px; background: var(--blush-soft); color: var(--terracotta-dk);
  font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: background .15s;
}
.grp-invite:hover { background: var(--blush); }
.grp-invite svg { width: 17px; height: 17px; }
.grp-tabs { top: 64px; }
.grp-content { height: calc(var(--app-h) - 64px - 46px); }

/* Invitation */
.invite-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: var(--radius); background: var(--blush-soft); margin-bottom: 10px; }
.invite-code__value { font-family: "SFMono-Regular", Consolas, monospace; font-size: 22px; font-weight: 800; letter-spacing: 3px; color: var(--terracotta-dk); }
.invite-copy { flex-shrink: 0; width: 38px; height: 38px; padding: 0; }
.invite-link { display: flex; gap: 8px; }
.invite-link .input { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-soft); }

/* Aperçu */
.gov { max-width: 1100px; margin: 0 auto; padding: 20px 22px 60px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; overflow-y: auto; height: 100%; }
.gov-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; min-width: 0; }
.gov-members { }
.gov .home-card__head .linkbtn { white-space: nowrap; }
.gov-count { font-family: var(--font-body); font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--text-muted); border-radius: 99px; padding: 1px 8px; }
.gov-mlist { display: flex; flex-direction: column; gap: 2px; }
.gov-m, .chat-side__m { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: none; text-align: left; font-family: inherit; padding: 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer; }
.gov-m:hover, .chat-side__m:hover { background: var(--surface-2); }
.gov-m__av { position: relative; flex: none; display: inline-flex; }
.gov-m__av i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); }
.gov-m__txt { min-width: 0; display: flex; flex-direction: column; }
.gov-m__txt b, .chat-side__m b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gov-m__txt b em { font-style: normal; font-weight: 600; color: var(--warm-grey); }
.gov-m__txt small, .chat-side__m small { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gov-actions { margin-top: 12px; }
.gov-files { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gov-file { border: none; background: none; padding: 0; font-family: inherit; cursor: pointer; text-align: left; min-width: 0; }
.gov-file__thumb { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; background: var(--surface-2); color: var(--terracotta); overflow: hidden; margin-bottom: 4px; }
.gov-file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gov-file small { display: block; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Discussion + membres */
.chat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 230px; grid-template-rows: minmax(0, 1fr); height: 100%; }
.chat-side { border-left: 1px solid var(--border); background: var(--offwhite); padding: 16px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.chat-side h3 { font-family: var(--font-body); font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); margin: 0 0 8px; }
.chat-side__m { margin: 0; padding: 6px; }
.chat-side__m > span:last-child { min-width: 0; }
.chat-side .linkbtn { margin-top: 8px; align-self: flex-start; }
.chat__empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text-muted); padding: 30px; }
.chat__empty b { color: var(--text); font-size: 16px; margin-top: 6px; }
.chat__empty small { font-size: 13px; }

.msg.is-grouped { margin-top: -2px; }
.msg.is-grouped .msg__av { visibility: hidden; width: 30px; height: 1px; flex: none; }
.msg.is-grouped .msg__time { display: none; }
.msg__line { display: flex; align-items: center; gap: 6px; }
.msg.mine .msg__line { flex-direction: row-reverse; }
.msg__bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.msg__tools { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.msg:hover .msg__tools { opacity: 1; }
.msg__tool { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--ink-soft); display: grid; place-items: center; cursor: pointer; }
.msg__tool:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
.msg__tool svg { width: 14px; height: 14px; }
.msg__quote {
  display: block; max-width: 100%; border: none; text-align: left; font-family: inherit; cursor: pointer; margin: 0 0 3px;
  padding: 5px 10px; border-left: 3px solid var(--nude); border-radius: 0 10px 10px 0; background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg__quote b { margin-right: 6px; color: var(--text); }
.msg__quote.is-gone { font-style: italic; cursor: default; }
.msg.mine .msg__quote { align-self: flex-end; }
.msg__reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.msg.mine .msg__reacts { justify-content: flex-end; }
.msg__react { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 1px 8px; font-size: 13px; cursor: pointer; }
.msg__react span { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); }
.msg__react.is-me { border-color: var(--nude); background: var(--blush-soft); }
.msg.is-flash .msg__bubble { box-shadow: 0 0 0 3px var(--blush); transition: box-shadow .3s; }
.react-pop { display: flex; gap: 2px; padding: 6px; border-radius: 99px; min-width: 0; }
.react-pop button { width: 38px !important; height: 38px; padding: 0 !important; justify-content: center; font-size: 22px !important; border-radius: 50% !important; transition: transform .12s; }
.react-pop button:hover { transform: scale(1.2); background: none !important; }
.chat__reply { display: flex; align-items: center; gap: 10px; padding: 8px 18px; background: var(--blush-soft); border-top: 1px solid var(--blush); font-size: 13px; color: var(--ink-soft); }
.chat__reply span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__reply[hidden] { display: none; }
.chat__bar { align-items: flex-end; }
.chat__bar textarea {
  flex: 1; min-width: 0; resize: none; max-height: 140px; padding: 11px 16px; border: 1px solid var(--border-strong); border-radius: 22px;
  font-family: inherit; font-size: 15px; line-height: 1.4; outline: none; background: var(--surface); color: var(--text);
}
.chat__bar textarea:focus { border-color: var(--nude); box-shadow: var(--ring); }
.typing-dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--nude); animation: typingDot 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typingDot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }

@media (max-width: 1100px) {
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-side { display: none; }
}
@media (max-width: 760px) {
  .gov { grid-template-columns: 1fr; padding: 14px 12px 60px; }
  .gov-members { }
  .grp-faces { display: none; }
  .grp-invite span { display: none; }
  .msg__tools { opacity: 1; }
}
/* ---------- Mode sombre : interrupteur & ajustements ---------- */
.rail__theme {
  width: 40px; height: 40px; border-radius: 12px; border: none; background: transparent; color: rgba(255,255,255,.7);
  display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s;
}
.rail__theme:hover { background: rgba(255,255,255,.12); color: #fff; }
.rail__theme svg { width: 19px; height: 19px; }
.theme-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); }
.theme-seg button {
  display: inline-flex; align-items: center; gap: 6px; border: none; background: none; border-radius: 99px; padding: 6px 12px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.theme-seg button svg { width: 15px; height: 15px; }
.theme-seg button.on { background: var(--surface); color: var(--terracotta-dk); box-shadow: inset 0 0 0 1px var(--border); }
:root[data-theme="dark"] .rail { background: linear-gradient(180deg, #2A2320 0%, #211C1A 45%, #1A1614 100%); border-right: 1px solid var(--border); }
:root[data-theme="dark"] .rail__badge { border-color: #211C1A; }
:root[data-theme="dark"] .board-addcol { border-color: rgba(255,255,255,.14); }
:root[data-theme="dark"] .ql-snow .ql-picker, :root[data-theme="dark"] .ql-snow .ql-picker-label { color: var(--ink-soft); }
:root[data-theme="dark"] .ql-snow .ql-picker-options { background: var(--surface); border-color: var(--border); }
:root[data-theme="dark"] .ql-snow .ql-fill { fill: var(--ink-soft); }
:root[data-theme="dark"] .ql-editor.ql-blank::before { color: var(--warm-grey); }
:root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select { color: var(--text); }

/* ---------- Groupes : liste des discussions ---------- */
.grp-item { padding: 9px 10px; }
.grp-item__top, .grp-item__bot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.grp-item__top b { flex: 1; min-width: 0; }
.grp-item__top time { flex: none; font-size: 11.5px; font-weight: 700; color: var(--warm-grey); }
.grp-item__bot small { flex: 1; min-width: 0; }
.grp-item__bot small em { font-style: normal; font-weight: 700; color: var(--ink-soft); }
.grp-item.has-unread .grp-item__top time { color: var(--terracotta-dk); }
.grp-item.has-unread .grp-item__bot small { color: var(--text); }
.grp-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); }
.grp-back { display: none; }

.grp-inbox { height: var(--app-h); overflow-y: auto; padding: 18px 14px 40px; max-width: 720px; margin: 0 auto; }
.grp-inbox__head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.grp-inbox__head h2 { flex: 1; font-size: 26px; }
.grp-inbox__search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 42px; margin-bottom: 10px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--warm-grey);
}
.grp-inbox__search:focus-within { border-color: var(--nude); box-shadow: var(--ring); }
.grp-inbox__search input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-family: inherit; font-size: 15px; color: var(--text); }
.grp-inbox__list { display: flex; flex-direction: column; gap: 2px; }
.grp-item--big { padding: 12px 10px; gap: 12px; }
.grp-item--big + .grp-item--big { border-top: 1px solid var(--border); border-radius: 0; }
.grp-item--big:hover { border-radius: 12px; }
.grp-item--big .grp-item__top b { font-size: 15.5px; }
.grp-item--big .grp-item__bot small { font-size: 13.5px; }

@media (max-width: 860px) {
  .grp-back { display: inline-grid; }
  .grp-invite { width: 34px; padding: 0; justify-content: center; }
  .grp-invite span { display: none; }
}

/* ---------- Administration+ : tableau de bord, annonces, journal ---------- */
.adm-note--warn { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-ink); font-size: 13.5px; margin-bottom: 14px; }
.adm-note--warn svg { width: 18px; height: 18px; flex: none; }
.adm-alert {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 14px; padding: 12px 16px; border: 1px solid var(--danger-line);
  border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-family: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.adm-alert span { flex: 1; }
.adm-alert:hover { border-color: var(--danger); }

.adm-kpis { display: grid; grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); gap: 12px; }
.adm-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-kpi__ic { width: 30px; height: 30px; border-radius: 9px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; margin-bottom: 8px; }
.adm-kpi__ic svg { width: 16px; height: 16px; }
.adm-kpi b { font-family: var(--font-display); font-size: 28px; line-height: 1.05; color: var(--text); }
.adm-kpi b small { font-family: var(--font-body); font-size: 14px; font-weight: 700; color: var(--warm-grey); }
.adm-kpi__l { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.adm-kpi__s { font-size: 12.5px; color: var(--text-muted); }
.adm-kpi--hero { background: var(--blush-soft); border-color: transparent; justify-content: center; gap: 6px; }
.adm-kpi--hero b { font-size: 38px; }
.adm-meter { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 70%, transparent); overflow: hidden; }
.adm-meter i { display: block; height: 100%; border-radius: 99px; background: var(--terracotta); }
.adm-delta { align-self: flex-start; margin-top: 6px; font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 2px 8px; }
.adm-delta.is-up { color: var(--ok-ink); background: var(--ok-soft); }
.adm-delta.is-down { color: var(--danger); background: var(--danger-soft); }
.adm-delta.is-flat { color: var(--text-muted); background: var(--surface-2); }
.adm-kpis + .adm-note { margin: 8px 0 18px; }

.adm-card__head { gap: 12px; flex-wrap: wrap; align-items: center; }
.adm-metric .seg { font-size: 12.5px; padding: 5px 11px; }
.adm-plot { position: relative; }
.adm-plot__sum { font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; }
.adm-plot__sum b { font-family: var(--font-display); font-size: 22px; color: var(--text); margin-right: 4px; }
.adm-plot__area { display: grid; grid-template-columns: auto 1fr; gap: 10px; height: 170px; }
.adm-plot__grid { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--warm-grey); text-align: right; padding-bottom: 1px; }
.adm-plot__bars {
  display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; align-items: end;
  background: linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 50%; border-bottom: 1px solid var(--border-strong);
}
.adm-col-bar { height: 100%; display: flex; align-items: flex-end; justify-content: center; border: none; background: none; padding: 0; cursor: default; border-radius: 4px; }
.adm-col-bar:hover, .adm-col-bar:focus-visible { background: var(--surface-2); }
.adm-col-bar i { display: block; width: 100%; max-width: 16px; border-radius: 4px 4px 0 0; background: var(--terracotta); transition: height .35s var(--ease); }
.adm-col-bar.is-we i { background: var(--nude); }
.adm-plot__x { display: flex; justify-content: space-between; margin: 6px 0 0 34px; font-size: 11px; color: var(--warm-grey); }
.adm-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; z-index: 2;
  background: var(--solid); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px;
}

.adm-grid2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.adm-col .adm-card:last-child { margin-bottom: 0; }
.adm-hbars { display: flex; flex-direction: column; gap: 10px; }
.adm-hbar { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.adm-hbar__l { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; min-width: 0; }
.adm-hbar__l svg { width: 16px; height: 16px; flex: none; color: var(--terracotta); }
.adm-hbar__l span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-hbar__track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.adm-hbar__track i { display: block; height: 100%; border-radius: 99px; background: var(--terracotta); }
.adm-hbar__v { text-align: right; font-weight: 800; color: var(--text-muted); font-size: 12.5px; }
.adm-list { display: flex; flex-direction: column; gap: 4px; }
.adm-li { display: flex; align-items: center; gap: 10px; padding: 6px 0; min-width: 0; }
.adm-li + .adm-li { border-top: 1px solid var(--border); }
.adm-li__rank { width: 18px; font-weight: 900; color: var(--warm-grey); font-size: 13px; text-align: center; }
.adm-li__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-li__txt b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-li__txt small { font-size: 12px; color: var(--text-muted); }
.adm-li__v { font-size: 12.5px; font-weight: 800; color: var(--terracotta-dk); }
.adm-empty-s { font-size: 13.5px; margin: 0; }

.adm-ann-form { display: flex; flex-direction: column; gap: 10px; }
.adm-ann-form textarea { resize: vertical; font-family: inherit; }
.adm-ann-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-ann-kind input { position: absolute; opacity: 0; pointer-events: none; }
.adm-ann-kind span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-strong); font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.adm-ann-kind span svg { width: 15px; height: 15px; }
.adm-ann-kind input:checked + span { border-color: var(--terracotta); background: var(--blush-soft); color: var(--terracotta-dk); }
.adm-ann-kind input:focus-visible + span { box-shadow: var(--ring); }
.adm-ann-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adm-ann-dur { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-muted); font-weight: 700; }
.adm-ann-dur select { width: auto; }
.adm-anns { display: flex; flex-direction: column; gap: 10px; }
.adm-ann { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.adm-ann.is-done { opacity: .65; }
.adm-ann__ic { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.adm-ann__main { flex: 1; min-width: 0; }
.adm-ann__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 4px; }
.adm-ann__top .adm-badge { margin-left: 0; }
.adm-ann__main b { font-size: 15px; color: var(--text); }
.adm-ann__main p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); white-space: pre-line; }
.adm-ann__acts { display: flex; align-items: center; gap: 4px; flex: none; }
.adm-badge--live { color: var(--ok-ink); background: var(--ok-soft); }
.adm-badge--soon { color: var(--warn-ink); background: var(--warn-soft); }
.adm-badge--done { color: var(--text-muted); background: var(--surface-2); }

.adm-log { padding: 6px 18px 12px; }
.adm-log__day { font-family: var(--font-body); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--warm-grey); font-weight: 800; margin: 14px 0 4px; }
.adm-log__row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--ink-soft); }
.adm-log__day + .adm-log__row { border-top: none; }
.adm-log__ic { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--surface-2); color: var(--terracotta); display: grid; place-items: center; }
.adm-log__txt { flex: 1; min-width: 0; line-height: 1.5; }
.adm-log__txt b { color: var(--text); }
.adm-log__txt small { display: block; color: var(--text-muted); font-size: 12px; }
.adm-log__row time { flex: none; font-size: 12px; color: var(--warm-grey); font-weight: 700; }

/* Annonce chez les membres */
.ann-pop {
  position: fixed; right: 18px; bottom: 18px; z-index: 70; width: min(380px, calc(100vw - 32px));
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 12px 14px 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); animation: annIn .3s var(--ease);
}
.ann-pop.is-out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.ann-pop__ic { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--blush-soft); color: var(--terracotta); display: grid; place-items: center; }
.ann-pop--maintenance .ann-pop__ic { background: var(--warn-soft); color: var(--warn-ink); }
.ann-pop--nouveaute .ann-pop__ic { background: var(--ok-soft); color: var(--ok-ink); }
.ann-pop__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ann-pop__txt small { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); }
.ann-pop__txt b { font-size: 15px; color: var(--text); }
.ann-pop__txt p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); white-space: pre-line; }
@keyframes annIn { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1100px) {
  .adm-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .adm-kpi--hero { grid-column: 1 / -1; }
  .adm-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-plot__bars { gap: 1px; }
  .adm-hbar { grid-template-columns: 104px 1fr 40px; }
  .adm-ann { flex-wrap: wrap; }
}

/* ---------- Administration : comptes ---------- */
.adm-toolbar--wrap { flex-wrap: wrap; }
.adm-sort { width: auto; min-width: 180px; height: 38px; padding: 0 10px; }
.adm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--surface); font-family: inherit; font-size: 13px; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.adm-chip span { font-size: 11px; font-weight: 800; color: var(--warm-grey); background: var(--surface-2); border-radius: 99px; padding: 0 6px; }
.adm-chip:hover { border-color: var(--nude); color: var(--text); }
.adm-chip.active { background: var(--solid); border-color: var(--solid); color: #fff; }
.adm-chip.active span { background: rgba(255,255,255,.18); color: #fff; }
.adm-table--users .adm-row { grid-template-columns: minmax(0, 2.4fr) 1fr 1.1fr .9fr .9fr .8fr 40px; }
.adm-row--click { cursor: pointer; }
.adm-row--click:focus-visible { outline: 2px solid var(--nude); outline-offset: -2px; }
.adm-acts-n { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.adm-role, .adm-status {
  display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; font-weight: 800;
  border-radius: 99px; padding: 2px 9px; white-space: nowrap;
}
.adm-role svg, .adm-status svg { width: 12px; height: 12px; }
.adm-role--admin { color: #fff; background: var(--terracotta); }
.adm-role--moderator { color: var(--terracotta-dk); background: var(--blush-soft); }
.adm-role--member { color: var(--text-muted); background: var(--surface-2); }
.adm-status--ok { color: var(--ok-ink); background: var(--ok-soft); }
.adm-status--susp { color: var(--danger); background: var(--danger-soft); }
.adm-status--ban { color: var(--warn-ink); background: var(--warn-soft); }
.adm-status--unconf { color: var(--text-muted); background: var(--surface-2); }

/* Fiche d'un compte */
.modal.modal--sheet { max-width: 680px; padding: 0 0 24px; max-height: 88vh; overflow-y: auto; }
.modal--sheet > :not(.us-head):not(.us-id) { margin-left: 26px; margin-right: 26px; }
.us-head { position: relative; height: 110px; background: var(--banner, linear-gradient(125deg, var(--blush) 0%, var(--blush-soft) 60%, var(--offwhite) 100%)) center / cover; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.us-x { position: absolute; top: 12px; right: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent); width: 34px; height: 34px; border-radius: 50%; }
.us-id { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 14px; padding: 0 26px; margin-top: -36px; }
.us-id__txt { margin-top: 42px; }
.us-id .avatar { border: 4px solid var(--surface); flex: none; font-size: 26px !important; }
.us-id__txt { min-width: 0; padding-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.us-id__txt h3 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-id__txt .muted { font-size: 13px; overflow-wrap: anywhere; }
.us-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.us-bio { font-size: 14px; color: var(--ink-soft); margin-top: 14px; white-space: pre-line; }
.us-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.us-meta span { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.us-meta b { font-size: 14px; color: var(--text); margin-top: 2px; }
.us-alert { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13.5px; }
.us-alert--soft { background: var(--warn-soft); color: var(--warn-ink); }
.us-alert svg { width: 16px; height: 16px; flex: none; }
.us-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.us-actions .btn { padding: 7px 12px; font-size: 13px; }
.us-actions .btn svg { width: 15px; height: 15px; }
.us-h { font-family: var(--font-body); font-size: 12px; letter-spacing: 1.1px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); margin-top: 20px; margin-bottom: 10px; }
.us-h .muted { letter-spacing: 0; }
.us-spark { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; align-items: end; height: 64px; border-bottom: 1px solid var(--border-strong); }
.us-spark i { display: block; background: var(--terracotta); border-radius: 3px 3px 0 0; }
.us-spark i.is-zero { background: var(--border); }
.us-note { font-size: 12.5px; margin-top: 6px; }
.us-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.us-stats div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.us-stats span { grid-row: span 2; color: var(--terracotta); display: grid; }
.us-stats span svg { width: 16px; height: 16px; }
.us-stats b { font-family: var(--font-display); font-size: 18px; line-height: 1.1; color: var(--text); }
.us-stats small { font-size: 11.5px; color: var(--text-muted); font-weight: 700; }
.us-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.us-groups > span { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--text); }
.us-groups small { font-weight: 600; color: var(--text-muted); }
.us-hist { display: flex; flex-direction: column; }
.us-hist > div { padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--ink-soft); }
.us-hist > div:first-child { border-top: none; }
.us-hist small { display: block; font-size: 12px; color: var(--text-muted); }

.adm-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); margin: 6px 0; cursor: pointer; }
.adm-check input:disabled + * , .adm-check:has(input:disabled) { opacity: .5; cursor: default; }
.adm-roles { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.adm-role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; }
.adm-role-opt input { margin-top: 3px; accent-color: var(--terracotta); }
.adm-role-opt span { display: flex; flex-direction: column; }
.adm-role-opt b { font-size: 14.5px; color: var(--text); }
.adm-role-opt small { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.adm-role-opt:has(input:checked) { border-color: var(--terracotta); background: var(--blush-soft); }

/* ---------- Administration : paramètres ---------- */
.set-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; }
.set-nav__b {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; border-radius: 12px; background: none;
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; text-align: left;
}
.set-nav__b svg { width: 18px; height: 18px; }
.set-nav__b:hover { background: var(--surface-2); color: var(--text); }
.set-nav__b.active { background: var(--blush-soft); color: var(--terracotta-dk); }
.set-body { min-width: 0; display: flex; flex-direction: column; }
.set-body .pp-panel textarea { resize: vertical; font-family: inherit; }
.set-save { display: flex; justify-content: flex-end; margin-top: 4px; }
.set-logo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.set-logo__prev { width: 72px; height: 72px; border-radius: 18px; background: #4A413D; display: grid; place-items: center; padding: 10px; flex: none; }
.set-logo__prev img { width: 100%; height: 100%; object-fit: contain; }
.set-logo__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.set-logo__acts label { cursor: pointer; }
.set-mfa { display: flex; gap: 14px; align-items: flex-start; }
.set-mfa__ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); color: var(--warm-grey); display: grid; place-items: center; }
.set-mfa__ic.is-on { background: var(--ok-soft); color: var(--ok-ink); }
.set-mfa b { font-size: 15px; color: var(--text); }
.set-mfa .pp-help { margin: 2px 0 0; }
.set-steps { margin: 8px 0; padding-left: 20px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.set-qr { display: grid; place-items: center; margin: 6px 0 10px; }
.set-qr img { width: 180px; height: 180px; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--border); }
.set-secret { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; user-select: all; }
.mfa-code { text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 800; font-variant-numeric: tabular-nums; height: 56px; }
.set-off { opacity: .8; }
.set-off .adm-badge { margin-left: 6px; vertical-align: 2px; }
.set-accents { display: flex; flex-wrap: wrap; gap: 10px; }
.set-accent {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 70px; padding: 10px 4px 8px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); font-family: inherit; font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer;
}
.set-accent i { width: 30px; height: 30px; border-radius: 50%; background: var(--sw); }
.set-accent.sel { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.set-accent--custom input { width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%; background: none; cursor: pointer; }
.set-accent--custom input::-webkit-color-swatch-wrapper { padding: 0; }
.set-accent--custom input::-webkit-color-swatch { border: none; border-radius: 50%; }
.set-preview { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); flex-wrap: wrap; }
.set-preview .adm-badge { margin-left: 0; }
.set-preview__link { color: var(--terracotta-dk); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.auth img.is-custom { max-height: 64px; width: auto; object-fit: contain; }

@media (max-width: 1100px) {
  .adm-table--users .adm-row { grid-template-columns: minmax(0, 2.4fr) 1fr 1.1fr .9fr 40px; }
  .adm-table--users .adm-row > :nth-child(4), .adm-table--users .adm-row > :nth-child(6) { display: none; }
}
@media (max-width: 760px) {
  .adm-table--users .adm-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .adm-table--users .adm-row > :nth-child(2), .adm-table--users .adm-row > :nth-child(5) { display: none; }
  .set-wrap { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .set-nav__b { flex: none; }
  .us-meta, .us-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal--sheet > :not(.us-head):not(.us-id) { margin-left: 18px; margin-right: 18px; }
  .us-id { padding: 0 18px; }
}

/* ---------- Explorer v3 : sélection, thèmes, types, abonnements, notifications ---------- */



/* Cloche */
.ex-bell { position: relative; flex: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.ex-bell:hover { background: var(--blush-soft); color: var(--terracotta-dk); }
.ex-bell svg { width: 20px; height: 20px; }
.ex-bell__n { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #E0605C; color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.ex-bell__n[hidden] { display: none; }
.ex-notifs {
  position: fixed; z-index: 80; width: min(380px, calc(100vw - 20px)); max-height: min(520px, calc(100vh - 100px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); overflow: hidden;
}
.ex-notifs__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.ex-notifs__head b { font-size: 15px; color: var(--text); }
.ex-notifs__list { overflow-y: auto; padding: 6px; }
.ex-notif { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px; border: none; background: none; border-radius: 14px; text-align: left; font-family: inherit; cursor: pointer; }
.ex-notif:hover { background: var(--surface-2); }
.ex-notif.is-new { background: var(--blush-soft); }
.ex-notif__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; }
.ex-notif__txt b { color: var(--text); }
.ex-notif__txt small { font-size: 12px; color: var(--text-muted); }
.ex-notif__ex { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: italic; }
.ex-notif__ic { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--terracotta); }
.ex-notif__ic svg { width: 13px; height: 13px; }
.ex-notif__ic--like { color: #E0605C; }
.ex-notif__ic--like svg { fill: currentColor; }
.ex-notifs__empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 28px 18px; margin: 0; font-size: 13.5px; color: var(--text-muted); }

/* Suivre */
.ex-follow {
  border: none; border-radius: 99px; padding: 10px 22px; font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  background: var(--terracotta); color: #fff; transition: background .15s;
}
.ex-follow:hover { background: var(--terracotta-dk); }
.ex-follow.is-on { background: var(--surface-2); color: var(--text); }
.ex-follow.is-on:hover { background: var(--danger-soft); color: var(--danger); }
.ex-follow--sm { padding: 8px 14px; font-size: 13px; margin-left: auto; }
.ex-author__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 4px 0 8px; }
.ex-author__stats span { display: flex; align-items: baseline; gap: 5px; font-size: 13.5px; color: var(--text-muted); }
.ex-author__stats b { font-size: 17px; color: var(--text); }
.ex-author #ex-author-count:empty { display: none; }
.ex-author #ex-author-count { font-size: 12px; background: var(--surface-2); border-radius: 99px; padding: 2px 10px; }

/* Mes publications : chiffres */
.ex-mystats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; max-width: 1200px; margin: -6px auto 20px; }
.ex-mystats div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.ex-mystats span { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--terracotta); }
.ex-mystats span svg { width: 16px; height: 16px; }
.ex-mystats b { font-family: var(--font-display); font-size: 20px; line-height: 1.1; color: var(--text); }
.ex-mystats small { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.pin__mystats { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 2px 0; padding: 7px 10px; border-radius: 12px; background: var(--surface-2); font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.pin__mystats span { display: inline-flex; align-items: center; gap: 4px; }
.pin__mystats svg { width: 12px; height: 12px; color: var(--terracotta); }
.pd__mystats { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.pd__mystats span { display: inline-flex; align-items: center; gap: 5px; }
.pd__mystats b { color: var(--text); }
.pd__mystats svg { width: 14px; height: 14px; color: var(--terracotta); }

@media (max-width: 1100px) {
  .ex-mystats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .ex-mystats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ex-bell { width: 42px; height: 42px; }
  .ex-top { gap: 8px; padding: 10px 12px; }
}

/* Explorer « Pinterest épuré » : thèmes en bulles, type dans un menu */
.ex-bubbles { display: flex; gap: 14px; justify-content: safe center; overflow-x: auto; padding: 8px 6px 6px; scrollbar-width: none; max-width: 1200px; margin: 0 auto; }
.ex-bubbles::-webkit-scrollbar { display: none; }
.ex-bubble { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 74px; border: none; background: none; padding: 0; font-family: inherit; cursor: pointer; }
.ex-bubble__dot {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--cc, var(--nude)) 26%, var(--mix-base)); color: color-mix(in srgb, var(--cc, var(--terracotta)) 55%, var(--mix-ink));
  transition: transform .15s var(--ease), box-shadow .15s;
}
.ex-bubble__dot--all { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.ex-bubble small { font-size: 12px; font-weight: 700; color: var(--text-muted); text-align: center; line-height: 1.25; }
.ex-bubble:hover .ex-bubble__dot { transform: translateY(-2px); }
.ex-bubble.active .ex-bubble__dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.ex-bubble.active small { color: var(--text); }
.ex-bubble:focus-visible { outline: none; }
.ex-bubble:focus-visible .ex-bubble__dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--nude); }
.ex-tools { display: flex; justify-content: center; margin: 6px 0 14px; }
.ex-typebtn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px;
  padding: 6px 12px; font-family: inherit; font-size: 13px; font-weight: 800; color: var(--text-muted); cursor: pointer;
}
.ex-typebtn svg { width: 14px; height: 14px; }
.ex-typebtn:hover { border-color: var(--nude); color: var(--text); }
.ex-typebtn.is-on { background: var(--solid); border-color: var(--solid); color: #fff; }
@media (max-width: 620px) {
  .ex-bubbles { gap: 10px; justify-content: flex-start; }
  .ex-bubble { width: 64px; }
  .ex-bubble__dot { width: 50px; height: 50px; }
}

/* ---------- Administration : mots interdits v2 ---------- */
.mw-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mw-ctx { display: flex; flex-direction: column; }
.mw-ctx__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.mw-ctx__row:first-child { border-top: none; padding-top: 0; }
.mw-ctx__row > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.mw-ctx__row b { font-size: 14px; color: var(--text); }
.mw-ctx__row small { font-size: 12.5px; color: var(--text-muted); }
.mw-ctx__row:has(input:disabled) { cursor: default; }
.mw-test { display: flex; gap: 8px; }
.mw-test .input { flex: 1; min-width: 0; }
.mw-result { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; }
.mw-result svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.mw-result span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.mw-result small { font-size: 12.5px; opacity: .85; }
.mw-result.is-ok { background: var(--ok-soft); color: var(--ok-ink); }
.mw-result.is-bad { background: var(--danger-soft); color: var(--danger); }
.mw-add { display: flex; flex-direction: column; gap: 10px; }
.mw-add textarea { resize: vertical; font-family: inherit; }
.mw-add__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mw-add__foot .adm-check { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.mw-search { max-width: 260px; }
.adm-word.is-prefix { border-color: var(--nude); background: var(--blush-soft); }
.mw-legend { display: inline-block; padding: 0 8px; border-radius: 99px; border: 1px solid var(--nude); background: var(--blush-soft); font-weight: 700; color: var(--text); }
.mw-legend--exact { border-color: var(--border); background: var(--surface); }

/* Annonces en haut de l'Accueil */
.home-anns { display: flex; flex-direction: column; gap: 10px; max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.home-anns:empty { display: none; }
.home-anns:not(:empty) { margin-top: 18px; margin-bottom: -4px; }
.home-ann { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.home-ann__ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--blush-soft); color: var(--terracotta); }
.home-ann--maintenance .home-ann__ic { background: var(--warn-soft); color: var(--warn-ink); }
.home-ann--nouveaute .home-ann__ic { background: var(--ok-soft); color: var(--ok-ink); }
.home-ann__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.home-ann__txt small { font-size: 11px; letter-spacing: .8px; text-transform: uppercase; font-weight: 800; color: var(--warm-grey); }
.home-ann__txt b { font-size: 15px; color: var(--text); }
.home-ann__txt span { font-size: 13.5px; color: var(--ink-soft); white-space: pre-line; }
@media (max-width: 860px) {
  .mw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .home-anns { padding: 0 14px; }
}

/* ---------- Administration : sécurité + journal façon « 15:42  Admin → Action » ---------- */
.auth__forgot { text-align: center; margin: 12px 0 0; }
.auth__forgot button { background: none; border: none; padding: 0; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.auth__forgot button:hover { color: var(--terracotta-dk); text-decoration: underline; }

.adm-log__row { align-items: baseline; gap: 14px; font-variant-numeric: tabular-nums; }
.adm-log__row time { order: -1; width: 44px; font-size: 13px; color: var(--text-muted); }
.adm-log__arrow { color: var(--warm-grey); margin: 0 2px; }
.adm-log__txt em { font-style: normal; color: var(--ink-soft); }
.adm-log__row--security .adm-log__txt b { color: var(--terracotta-dk); }

.sec-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.sec-kpi { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.sec-kpi span { grid-row: span 2; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blush-soft); color: var(--terracotta); }
.sec-kpi span svg { width: 17px; height: 17px; }
.sec-kpi b { font-family: var(--font-display); font-size: 24px; line-height: 1.1; color: var(--text); }
.sec-kpi small { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.sec-kpi.is-alert span { background: var(--danger-soft); color: var(--danger); }
.sec-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.sec-row:first-child { border-top: none; padding-top: 0; }
.sec-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sec-row__main b { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-row__main small { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-row__when { flex: none; font-size: 12.5px; color: var(--text-muted); }
.sec-dev { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-soft); }
.sec-dev svg { width: 16px; height: 16px; }
.sec-kill { padding: 6px 12px; font-size: 13px; flex: none; }
.sec-mfa { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 9px; color: var(--text-muted); background: var(--surface-2); }
.sec-mfa svg { width: 12px; height: 12px; }
.sec-mfa.is-on { color: var(--ok-ink); background: var(--ok-soft); }
.sec-mfa.is-off { color: var(--warn-ink); background: var(--warn-soft); }
.sec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sec-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; }
.sec-line { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--ink-soft); }
.sec-line:first-child { border-top: none; }
.sec-line time { flex: none; width: 92px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sec-line > span { min-width: 0; }
.sec-line b { color: var(--text); }
.sec-line small { display: block; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.sec-line.is-alert { background: var(--danger-soft); margin: 0 -10px; padding: 8px 10px; border-radius: 10px; }
.sec-tag { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 1px 8px; margin-left: 4px; }
.sec-tag--ok { color: var(--ok-ink); background: var(--ok-soft); }
.sec-tag--warn { color: var(--warn-ink); background: var(--warn-soft); }
.sec-tag--bad { color: var(--danger); background: var(--danger-soft); }
.sec-tag--neutral { color: var(--text-muted); background: var(--surface-2); }
@media (max-width: 1000px) {
  .sec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .sec-row { flex-wrap: wrap; }
  .sec-row__when { order: 3; width: 100%; padding-left: 44px; }
  .sec-line { flex-direction: column; gap: 2px; }
}

/* ---------- RGPD : inscription, conditions, cookies, pages légales ---------- */
.auth__check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); cursor: pointer; text-align: left; }
.auth__check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--terracotta); }
.auth__check a { color: var(--terracotta-dk); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.auth__legal { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--text-muted); }
.auth__legal a { color: var(--text-muted); }
.auth__legal a:hover { color: var(--terracotta-dk); text-decoration: underline; }

.terms-gate { z-index: 200; }
.terms-modal { max-width: 480px; }
.terms-links { margin: 6px 0 16px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.terms-links a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px; }
.terms-links a::after { content: "↗"; margin-left: auto; color: var(--warm-grey); }
.terms-links a:hover { background: var(--blush-soft); color: var(--terracotta-dk); }

.cookie-info {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; width: min(760px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: cookieIn .35s var(--ease);
}
.cookie-info__ic { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: var(--blush-soft); }
.cookie-info__txt { flex: 1; min-width: 0; }
.cookie-info__title { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cookie-info__txt p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.cookie-info__txt p b { color: var(--text); }
.cookie-info__acts { display: flex; flex-direction: column; gap: 8px; flex: none; }
.cookie-info__acts .btn { justify-content: center; padding: 11px 20px; white-space: nowrap; }
@keyframes cookieIn { from { opacity: 0; transform: translate(-50%, 16px); } }
@media (max-width: 620px) {
  .cookie-info { bottom: 12px; flex-direction: column; align-items: stretch; text-align: left; gap: 12px; padding: 18px; }
  .cookie-info__ic { width: 46px; height: 46px; font-size: 24px; }
  .cookie-info__acts { flex-direction: row-reverse; }
  .cookie-info__acts .btn { flex: 1; }
}
.pp-legal { margin-top: 14px; }
.pp-legal a { color: var(--terracotta-dk); font-weight: 700; }

.legal-body { background: var(--bg); min-height: 100vh; }
.legal-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 24px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.legal-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text); }
.legal-brand img { width: 28px; height: 28px; }
.legal-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.legal-nav a { padding: 6px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 700; color: var(--text-muted); }
.legal-nav a:hover { background: var(--surface-2); color: var(--text); }
.legal-nav a[aria-current="page"] { background: var(--solid); color: #fff; }
.legal { max-width: 760px; margin: 0 auto; padding: 36px 24px 80px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.75; }
.legal h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 4px; }
.legal h2 { font-size: 21px; margin: 30px 0 8px; }
.legal h3 { font-family: var(--font-body); font-size: 15px; font-weight: 800; color: var(--text); margin: 16px 0 4px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal b { color: var(--text); }
.legal a { color: var(--terracotta-dk); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.legal code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.legal-date { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px !important; }
.legal-note { font-size: 13.5px; color: var(--text-muted); }
.legal-todo { background: var(--warn-soft); color: var(--warn-ink); border-radius: 4px; padding: 0 4px; font-weight: 700; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 14px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.legal-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--warm-grey); }
.legal-back { margin-top: 36px !important; }
@media (max-width: 620px) {
  .legal-top { padding: 12px 14px; }
  .legal-nav { margin-left: 0; }
  .legal { padding: 24px 16px 60px; }
  .legal-table { font-size: 13px; }
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .legal-table td { display: block; border: none; padding: 2px 0; }
}

/* Équipe : double authentification requise */
.staff-mfa { max-width: 460px; }
.staff-mfa__ic { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--blush-soft); color: var(--terracotta); }
.staff-mfa__ic svg { width: 34px; height: 34px; }
.staff-mfa p { line-height: 1.6; }

/* ---------- Mobile ---------- */
.sidebar__toggle { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: var(--rail-w) 1fr; }
  .workarea--notes { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 var(--rail-w); width: 80%; max-width: var(--sidebar-w); z-index: 40;
    transform: translateX(calc(-100% - var(--rail-w))); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar__toggle { display: inline-flex; }
  .page { padding: 28px 18px 120px; }
  .page__title { font-size: 32px; }
}
@media (max-width: 620px) {
  .module, .cal { padding-left: 14px; padding-right: 14px; }
  .empty { padding: 28px 18px; }
}
@media (max-width: 480px) {
  .ql-toolbar.ql-snow { gap: 0; }
  .ql-toolbar.ql-snow .ql-formats { margin-right: 6px; }
}

/* ---------- Menu coulissant (téléphone) ---------- */
@supports (height: 100dvh) { :root { --app-h: 100dvh; } }
.mhead, .rail-scrim, .rail__lbl, .rail__brand, .rail__close { display: none; }
.rail__head { display: contents; }
.rail__me { display: contents; }
.rail__mod { position: relative; }

@media (max-width: 760px) {
  :root { --app-h: calc(100vh - 56px); }
  @supports (height: 100dvh) { :root { --app-h: calc(100dvh - 56px); } }
  .app { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; height: 100vh; height: 100dvh; }

  /* En-tête */
  .mhead {
    display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 56px; min-width: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); position: relative; z-index: 5;
  }
  .mhead__menu {
    position: relative; width: 40px; height: 40px; flex: none; border: none; border-radius: 12px;
    background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer;
  }
  .mhead__menu:hover, .mhead__menu:focus-visible { background: var(--surface-2); }
  .app:has(#rail-badge-groups:not([hidden])) .mhead__menu::after,
  .app:has(#rail-badge-explore:not([hidden])) .mhead__menu::after {
    content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
    background: #E0605C; border: 2px solid var(--bg);
  }
  .mhead__title { display: flex; align-items: center; gap: 8px; min-width: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--text); }
  .mhead__title svg { width: 19px; height: 19px; flex: none; color: var(--terracotta); }
  .mhead__title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Tiroir */
  .rail-scrim {
    display: block; position: fixed; inset: 0; z-index: 60; background: rgba(40, 33, 30, .45);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .rail {
    position: fixed; inset: 0 auto 0 0; z-index: 61; width: min(290px, 84vw); height: 100%;
    align-items: stretch; gap: 4px; padding: 14px 12px 18px; overflow-y: auto;
    transform: translateX(-102%); transition: transform .26s var(--ease); visibility: hidden;
  }
  .app.drawer-open .rail { transform: none; visibility: visible; }
  .app.drawer-open .rail-scrim { opacity: 1; pointer-events: auto; }

  .rail__head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 12px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .rail__logo { width: 38px; height: 38px; }
  .rail__brand { display: block; flex: 1; font-family: var(--font-display); font-size: 21px; font-weight: 600; color: #fff; }
  .rail__close {
    display: grid; place-items: center; width: 36px; height: 36px; border: none; border-radius: 10px;
    background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); cursor: pointer;
  }
  .rail__close:hover { background: rgba(255,255,255,.16); color: #fff; }

  .rail__mods { gap: 2px; margin-top: 0; }
  .rail__sep { width: auto; margin: 6px 12px; }
  .rail__mod, .rail__theme {
    width: 100%; height: 46px; display: flex; align-items: center; justify-content: flex-start; gap: 14px;
    padding: 0 12px; border-radius: 12px; background: transparent; font-size: 15px;
  }
  .rail__mod.active { box-shadow: none; }
  .rail__mod.active::before { display: none; }
  .rail__mod-ico { display: grid; place-items: center; flex: none; }
  .rail__lbl { display: block; font-family: var(--font-body); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail__badge { position: static; margin-left: auto; border-color: transparent; }
  .rail__timer { margin-left: auto; }
  .rail__theme { color: rgba(255,255,255,.8); margin-top: 8px; border-top: 1px solid rgba(255,255,255,.1); border-radius: 0 0 12px 12px; }

  .rail__me { display: flex; align-items: center; gap: 12px; padding: 8px 8px 0; }
  /* Onglets de groupe sur une ligne (défilables) pour garder la hauteur prévue */
  .grp-tabs { overflow-x: auto; scrollbar-width: none; padding-left: 10px; padding-right: 10px; }
  .grp-tabs::-webkit-scrollbar { display: none; }
  .grp-tab { white-space: nowrap; flex: none; padding: 9px 11px; }
  .rail__me-lbl { border: none; background: none; color: #fff; cursor: pointer; padding: 6px 0; text-align: left; flex: 1; }

  /* Panneaux propres à chaque espace (liste des notes, tableaux…) */
  .sidebar { inset: 0 auto 0 0; z-index: 50; transform: translateX(-102%); height: 100%; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .rail, .rail-scrim { transition: none; }
}

/* ============================================================
   TÉLÉPHONE — rien ne dépasse de l'écran ni de son bouton
   ============================================================ */
/* Les fenêtres ne sont jamais plus larges que l'écran (les champs date/heure forçaient la largeur) */
.overlay > .modal { min-width: 0; }
.field-row .field, .input { min-width: 0; }

@media (max-width: 760px) {
  /* iPhone zoome automatiquement sur un champ en dessous de 16px et la page reste zoomée/coupée */
  /* (les grands champs de titre gardent leur taille ; l'éditeur de code grossit en entier pour rester aligné) */
  :is(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select):not([class*="__title"], .codebox__input) { font-size: 16px !important; }
  .ql-editor, .codebox__body { font-size: 16px; }

  html, body { overflow-x: hidden; }
  .overlay { padding: 12px; }
  .overlay > .modal { max-width: 100%; }
  .modal { padding: 22px 18px; max-height: calc(100dvh - 24px); overflow-y: auto; }

  /* Les textes passent à la ligne dans leur bouton au lieu d'en sortir */
  .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .btn > span { min-width: 0; }
  .empty { padding: 28px 18px; }
  .empty p, .empty b, .empty h3 { overflow-wrap: anywhere; }

  /* Discussion : bulles plus larges, outils (réagir/répondre/supprimer) visibles au toucher */
  .chat__msgs { padding: 14px 12px; }
  .msg { max-width: 88%; }
  .msg__tools { display: none; }
  .msg:hover .msg__tools, .msg:focus-within .msg__tools { display: flex; }
  .chat__bar { padding: 10px 12px; gap: 8px; }
  .chat__notif { padding: 8px 12px; font-size: 12.5px; }

  /* Onglets du groupe : tiennent sur la largeur */
  .grp-tabs { gap: 0; }
  .grp-tab { flex: 1 1 0; min-width: 0; justify-content: center; padding: 10px 4px; font-size: 13px; }
  .grp-tab svg { display: none; }
  .grp-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Liste des discussions */
  .grp-inbox__head { flex-wrap: wrap; }
  .grp-inbox__head h2 { font-size: 22px; min-width: 0; }
  .grp-inbox__head .btn { padding: 8px 12px; }

  /* Profil : lignes de réglage et boutons */
  .pp-row--ctl { flex-wrap: wrap; }
  .theme-seg { max-width: 100%; }
  .pp-actions .btn { flex: 1 1 100%; }

  /* Code : la barre au-dessus du code passe sur deux lignes si besoin */
  .codebox__bar { flex-wrap: wrap; row-gap: 8px; }
  .codebox__file { min-width: 0; flex: 1 1 120px; }

  /* Focus : chiffres du jour en colonne pour que les libellés tiennent */
  .focus-stats .goal-stat { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
  .focus-stats .goal-stat > span:last-child { overflow-wrap: anywhere; }
  .goal-stat > span:last-child { min-width: 0; overflow-wrap: anywhere; }

  /* Formulaires : les champs rétrécissent, les boutons passent à la ligne */
  .modal__actions { flex-wrap: wrap; }
  .checklist__add input, .rem-add__opts > * { min-width: 0; max-width: 100%; }
  .gnote-editor { padding: 14px 12px 80px; }
  .gnote-editor #gn-title { font-size: 24px; }
  .gnote-editor .ql-toolbar.ql-snow { top: 109px; }
}
@media (max-width: 380px) {
  .grp-inbox__head h2 { font-size: 20px; }
  .goal-stat > span:last-child { font-size: 11.5px; }
  .modal__actions .btn { flex: 1 1 auto; }
}

/* Accueil v3 : carte « À suivre », deux colonnes, couleurs par espace */
.home-hero__in { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: center; }
.home-hero__txt { min-width: 0; }
.home-next {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--nude));
}
.home-next__lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--warm-grey); }
.home-next__lbl i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); animation: focusPulse 1.6s ease-in-out infinite; }
.home-next.is-now .home-next__lbl { color: var(--terracotta-dk); }
.home-next__title { font-family: var(--font-display); font-size: 21px; line-height: 1.2; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-next__time { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.home-next__in { align-self: flex-start; margin-top: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; color: var(--terracotta-dk); background: var(--blush-soft); }
.home-next small { font-size: 12.5px; color: var(--text-muted); }
.home-next__bar, .home-next__daybar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.home-next__bar span { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.home-next__day { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.home-next__daytop { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.home-next__daytop b { color: var(--text); }
.home-next__daybar span { display: block; height: 100%; border-radius: inherit; background: var(--terracotta); transition: width .6s var(--ease); }

/* Alignement : en-tête, chiffres et cartes sur la même largeur */
.home-strip { max-width: 1156px; }

/* Deux colonnes indépendantes */
.home-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Une couleur douce par espace (icônes des chiffres, des raccourcis et des cartes) */
.home-kpi--cal, .home-act[data-act="event"] { --k: #8FA8C9; }
.home-kpi--rem { --k: #D9B44A; }
.home-kpi--focus, .home-act[data-act="focus"] { --k: var(--terracotta); }
.home-kpi--goal, .home-act[data-act="goal"] { --k: #A58BD0; }
.home-act[data-act="note"] { --k: #C28374; }
.home-kpi:not(.is-alert) .home-kpi__ic { background: color-mix(in srgb, var(--k) 18%, var(--mix-base)); color: color-mix(in srgb, var(--k) 80%, var(--mix-ink)); }
.home-act svg { color: var(--k, var(--terracotta)); }
.home-kpi:hover { border-color: color-mix(in srgb, var(--k, var(--nude)) 60%, var(--mix-base)); }
.home-card__head h2 svg { box-sizing: content-box; padding: 6px; border-radius: 9px; background: var(--blush-soft); }
.home-today .home-card__head h2 svg { color: #6F8BB3; background: color-mix(in srgb, #8FA8C9 18%, var(--mix-base)); }
.home-goals .home-card__head h2 svg { color: #8A6DBE; background: color-mix(in srgb, #A58BD0 18%, var(--mix-base)); }

@media (max-width: 980px) {
  .home-hero__in { grid-template-columns: 1fr; gap: 18px; }
  .home-next { max-width: 460px; }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .home-next { max-width: none; }
}
