/* ==========================================================================
   Mémo — feuille de style
   Thème sombre par défaut, thème clair via [data-theme="light"].
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --spring: cubic-bezier(.2, .8, .2, 1);
  --spring-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --side-w: 256px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* ——— sombre ——— */
  --bg: #07080d;
  --bg-2: #0b0d15;
  --card: rgba(255, 255, 255, .032);
  --card-hover: rgba(255, 255, 255, .055);
  --card-solid: #11131d;
  --glass: rgba(15, 17, 27, .6);
  --glass-strong: rgba(14, 16, 25, .84);
  --fill: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --hi: rgba(255, 255, 255, .06);
  --text: #eef0f8;
  --text-2: #a5aabd;
  --text-3: #7a8096;
  --accent: #8b5cf6;
  --accent-l: #a78bfa;
  --accent-ll: #c4b5fd;
  --indigo-l: #a5b4fc;
  --cyan-l: #67e8f9;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 48%, #06b6d4 100%);
  --grad-wide: linear-gradient(110deg, #8b5cf6 0%, #6366f1 30%, #06b6d4 60%, #6366f1 80%, #8b5cf6 100%);
  --grad-text: linear-gradient(110deg, #ddd6fe 0%, #a5b4fc 45%, #67e8f9 100%);
  --late: #fb7185;
  --late-strong: #f43f5e;
  --late-bg: rgba(244, 63, 94, .075);
  --late-line: rgba(251, 113, 133, .22);
  --warn: #fbbf24;
  --ok: #34d399;
  --ring-track: rgba(255, 255, 255, .07);
  --check-line: rgba(255, 255, 255, .24);
  --scrim: rgba(3, 4, 9, .58);
  --shadow-1: 0 1px 1px rgba(0, 0, 0, .25), 0 2px 6px -2px rgba(0, 0, 0, .35);
  --shadow-2: 0 1px 1px rgba(0, 0, 0, .3), 0 8px 22px -8px rgba(0, 0, 0, .55), 0 22px 44px -18px rgba(0, 0, 0, .5);
  --shadow-3: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 60px -12px rgba(0, 0, 0, .7), 0 48px 120px -30px rgba(0, 0, 0, .6);
  --orb-1: #6d28d9;
  --orb-2: #0891b2;
  --orb-3: #4338ca;
  --orb-o: .38;
  --grain-o: .055;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-2: #eceef6;
  --card: rgba(255, 255, 255, .66);
  --card-hover: rgba(255, 255, 255, .92);
  --card-solid: #ffffff;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .86);
  --fill: rgba(15, 23, 42, .045);
  --fill-2: rgba(15, 23, 42, .075);
  --line: rgba(15, 23, 42, .08);
  --line-2: rgba(15, 23, 42, .14);
  --hi: rgba(255, 255, 255, .9);
  --text: #0d1022;
  --text-2: #4a5069;
  --text-3: #62687f;
  --accent: #7c3aed;
  --accent-l: #7c3aed;
  --accent-ll: #6d28d9;
  --indigo-l: #4f46e5;
  --cyan-l: #0e7490;
  --grad-text: linear-gradient(110deg, #7c3aed 0%, #4f46e5 45%, #0891b2 100%);
  --late: #e11d48;
  --late-strong: #e11d48;
  --late-bg: rgba(244, 63, 94, .065);
  --late-line: rgba(225, 29, 72, .2);
  --warn: #b45309;
  --ok: #059669;
  --ring-track: rgba(15, 23, 42, .075);
  --check-line: rgba(15, 23, 42, .26);
  --scrim: rgba(30, 32, 56, .26);
  --shadow-1: 0 1px 1px rgba(16, 24, 64, .05), 0 2px 6px -2px rgba(16, 24, 64, .08);
  --shadow-2: 0 1px 1px rgba(16, 24, 64, .04), 0 8px 22px -10px rgba(16, 24, 64, .14), 0 20px 40px -24px rgba(16, 24, 64, .16);
  --shadow-3: 0 2px 6px rgba(16, 24, 64, .06), 0 24px 60px -16px rgba(16, 24, 64, .25), 0 40px 100px -30px rgba(16, 24, 64, .22);
  --orb-1: #c4b5fd;
  --orb-2: #a5f3fc;
  --orb-3: #c7d2fe;
  --orb-o: .7;
  --grain-o: .035;
  color-scheme: light;
}

/* Couleurs de projet / notes (triplets RGB) */
.c-violet, .nc-violet, .sw-violet { --c: 139 92 246; --ct: #c4b5fd; }
.c-blue, .nc-blue, .sw-blue { --c: 59 130 246; --ct: #93c5fd; }
.c-cyan, .nc-cyan, .sw-cyan { --c: 6 182 212; --ct: #67e8f9; }
.c-green, .nc-green, .sw-green { --c: 16 185 129; --ct: #6ee7b7; }
.c-amber, .nc-amber, .sw-amber { --c: 245 158 11; --ct: #fcd34d; }
.c-orange, .nc-orange, .sw-orange { --c: 249 115 22; --ct: #fdba74; }
.c-rose, .nc-rose, .sw-rose { --c: 244 63 94; --ct: #fda4af; }
.c-slate, .nc-slate, .sw-slate { --c: 100 116 139; --ct: #cbd5e1; }
[data-theme="light"] :is(.c-violet, .nc-violet) { --ct: #6d28d9; }
[data-theme="light"] :is(.c-blue, .nc-blue) { --ct: #1d4ed8; }
[data-theme="light"] :is(.c-cyan, .nc-cyan) { --ct: #0e7490; }
[data-theme="light"] :is(.c-green, .nc-green) { --ct: #047857; }
[data-theme="light"] :is(.c-amber, .nc-amber) { --ct: #a16207; }
[data-theme="light"] :is(.c-orange, .nc-orange) { --ct: #c2410c; }
[data-theme="light"] :is(.c-rose, .nc-rose) { --ct: #be123c; }
[data-theme="light"] :is(.c-slate, .nc-slate) { --ct: #475569; }

/* ——————————————————————————————————————————— base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color .4s var(--spring), color .4s var(--spring);
}
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible:not(input, textarea, select) { outline: 2px solid var(--accent-l); outline-offset: 2px; }
::selection { background: rgba(139, 92, 246, .35); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.pad { padding: 4px 6px; }
.strike { text-decoration: line-through; color: var(--text-3); }
.t-late { color: var(--late); font-weight: 600; }
.ic { width: 20px; height: 20px; flex: none; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  font: 600 11px/1 var(--font); letter-spacing: .02em;
  color: var(--text-3);
  background: var(--fill);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
}
code { font: 12.5px var(--mono); background: var(--fill); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; color: var(--text-2); }

/* ——————————————————————————————————————————— arrière-plan */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(1200px 600px at 50% -200px, rgba(99, 102, 241, .10), transparent 70%);
}
[data-theme="light"] .backdrop::before { background: radial-gradient(1200px 600px at 50% -200px, rgba(255, 255, 255, .9), transparent 70%); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-o); will-change: transform; }
.orb-1 { width: 620px; height: 620px; left: -180px; top: -220px; background: radial-gradient(circle at 40% 40%, var(--orb-1), transparent 68%); animation: drift-1 46s ease-in-out infinite alternate; }
.orb-2 { width: 520px; height: 520px; right: -160px; top: 8%; background: radial-gradient(circle at 50% 50%, var(--orb-2), transparent 66%); opacity: calc(var(--orb-o) * .7); animation: drift-2 58s ease-in-out infinite alternate; }
.orb-3 { width: 760px; height: 760px; left: 22%; bottom: -420px; background: radial-gradient(circle at 50% 50%, var(--orb-3), transparent 66%); opacity: calc(var(--orb-o) * .8); animation: drift-3 64s ease-in-out infinite alternate; }
@keyframes drift-1 { to { transform: translate(180px, 140px) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-200px, 180px) scale(.9); } }
@keyframes drift-3 { to { transform: translate(-160px, -120px) scale(1.1); } }
.grain {
  position: absolute; inset: 0; opacity: var(--grain-o); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .grain { mix-blend-mode: multiply; filter: invert(1); }

/* ——————————————————————————————————————————— boutons */
.btn-primary, .btn-ghost, .btn-danger {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 13px;
  font-size: 14px; font-weight: 650; letter-spacing: -.005em;
  white-space: nowrap;
  transition: transform .25s var(--spring), box-shadow .25s var(--spring), background-position .6s var(--spring), background-color .2s, border-color .2s, color .2s, opacity .2s;
}
.btn-primary {
  color: #fff;
  background: var(--grad-wide);
  background-size: 220% 100%;
  background-position: 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .15), 0 1px 2px rgba(30, 16, 80, .35), 0 8px 22px -8px rgba(99, 102, 241, .75);
}
.btn-primary:hover:not(:disabled) { background-position: 60% 0; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(30, 16, 80, .35), 0 12px 28px -8px rgba(99, 102, 241, .85); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn-primary:disabled { opacity: .42; box-shadow: none; }
.btn-primary .ic, .btn-ghost .ic, .btn-danger .ic { width: 17px; height: 17px; }
.btn-primary kbd { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .85); margin-left: 2px; }
.btn-ghost { color: var(--text); background: var(--fill); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--fill-2); border-color: var(--line-2); }
.btn-ghost:active { transform: scale(.97); }
.btn-danger { color: var(--late); background: var(--late-bg); border: 1px solid var(--late-line); }
.btn-danger:hover { background: rgba(244, 63, 94, .14); }
.btn-danger.confirm { background: var(--late-strong); color: #fff; border-color: transparent; animation: pulse-danger 1.4s ease-in-out infinite; }
@keyframes pulse-danger { 50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, .18); } }
.sm { height: 34px; padding: 0 12px; border-radius: 11px; font-size: 13px; }
.lg { height: 52px; font-size: 16px; border-radius: 16px; }
.block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 11px; color: var(--text-2);
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.icon-btn:hover { background: var(--fill-2); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.xs .ic { width: 15px; height: 15px; }
.icon-btn.danger:hover { color: var(--late); background: var(--late-bg); }
.icon-btn[aria-pressed="true"] { color: var(--accent-l); }

/* ——————————————————————————————————————————— halo qui suit la souris */
.glow { position: relative; isolation: isolate; }
.glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(167, 139, 250, .11), transparent 45%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.pcard.glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgb(var(--c, 139 92 246) / .7), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
@media (hover: hover) {
  .glow:hover::before, .pcard.glow:hover::after { opacity: 1; }
}
[data-theme="light"] .glow::before { background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 58, 237, .07), transparent 45%); }

/* ——————————————————————————————————————————— mise en page */
.app { min-height: 100vh; min-height: 100dvh; }
.main { padding: 44px 56px 140px calc(var(--side-w) + 24px + 56px); }
.view-root { max-width: 1080px; margin: 0 auto; view-transition-name: view; }
.topbar, .tabbar { display: none; }
.hide-mobile { }

/* Barre latérale */
.sidebar {
  position: fixed; z-index: 40;
  left: 12px; top: 12px; bottom: 12px; width: var(--side-w);
  display: flex; flex-direction: column;
  padding: 14px 12px 12px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-size: 18px; font-weight: 750; letter-spacing: -.03em; }
.brand img { border-radius: 9px; box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .7); }
.side-search {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 38px; padding: 0 8px 0 11px; margin-bottom: 14px;
  color: var(--text-3); font-size: 13.5px;
  background: var(--fill); border: 1px solid var(--line); border-radius: 11px;
  transition: border-color .2s, background .2s, color .2s;
}
.side-search .ic { width: 16px; height: 16px; }
.side-search span { flex: 1; text-align: left; }
.side-search:hover { border-color: var(--line-2); color: var(--text-2); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 10px 0 12px;
  border-radius: 11px;
  color: var(--text-2); font-size: 14px; font-weight: 560;
  transition: background .2s, color .2s;
}
.side-nav a .ic { width: 19px; height: 19px; transition: color .2s, transform .3s var(--spring); }
.side-nav a:hover { background: var(--fill); color: var(--text); }
.side-nav a:hover .ic { transform: scale(1.08); }
.side-nav a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139, 92, 246, .2), rgba(99, 102, 241, .07));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .24), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.side-nav a.active .ic { color: var(--accent-l); }
.side-nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--grad); box-shadow: 0 0 12px rgba(139, 92, 246, .8);
}
[data-theme="light"] .side-nav a.active { background: linear-gradient(90deg, rgba(124, 58, 237, .12), rgba(99, 102, 241, .04)); }
.nav-badge {
  margin-left: auto;
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--fill-2); color: var(--text-2);
}
.nav-badge.late { background: var(--late-strong); color: #fff; box-shadow: 0 0 0 3px rgba(244, 63, 94, .15), 0 4px 12px -2px rgba(244, 63, 94, .6); }
.nav-badge.warn { background: rgba(251, 191, 36, .16); color: var(--warn); }
.side-section {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 4px 6px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3);
}
.side-projects { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; scrollbar-width: none; }
.side-projects::-webkit-scrollbar { display: none; }
.side-proj {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 10px 0 13px; border-radius: 10px;
  font-size: 13.5px; color: var(--text-2);
  transition: background .2s, color .2s;
}
.side-proj:hover { background: var(--fill); color: var(--text); }
.side-proj.active { background: rgb(var(--c) / .14); color: var(--text); }
.side-proj .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: rgb(var(--c)); box-shadow: 0 0 10px rgb(var(--c) / .7); }
.side-proj-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: 12px; color: var(--text-3); }
.side-proj .nav-badge { margin-left: 0; min-width: 18px; height: 18px; font-size: 10.5px; }
.side-empty { padding: 6px 13px; font-size: 13px; color: var(--text-3); }
.side-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-capture {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 42px; padding: 0 9px 0 12px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--text);
  background: linear-gradient(135deg, rgba(139, 92, 246, .2), rgba(6, 182, 212, .1));
  border: 1px solid rgba(139, 92, 246, .3);
  transition: transform .25s var(--spring), box-shadow .25s, border-color .2s;
}
.side-capture span { flex: 1; text-align: left; }
.side-capture .ic { width: 18px; height: 18px; color: var(--accent-l); }
.side-capture:hover { transform: translateY(-1px); box-shadow: 0 8px 22px -10px rgba(139, 92, 246, .8); border-color: rgba(139, 92, 246, .5); }
.side-tools { display: flex; justify-content: space-between; margin-top: 10px; }

/* FAB */
.fab {
  position: fixed; z-index: 60;
  right: 28px; bottom: 28px;
  width: 58px; height: 58px; border-radius: 19px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--grad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .12), 0 2px 4px rgba(40, 20, 100, .3), 0 14px 34px -8px rgba(99, 102, 241, .85);
  transition: transform .35s var(--spring-bounce), box-shadow .3s;
}
.fab .ic { width: 27px; height: 27px; stroke-width: 2.4; transition: transform .45s var(--spring-bounce); }
.fab:hover { transform: translateY(-2px) scale(1.04); }
.fab:hover .ic { transform: rotate(90deg); }
.fab:active { transform: scale(.94); }
.fab::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(139, 92, 246, .5);
  animation: fab-pulse 4.5s ease-out infinite 2s;
}
@keyframes fab-pulse { 0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .45); } 30%, 100% { box-shadow: 0 0 0 16px rgba(139, 92, 246, 0); } }
body.has-overlay .fab { transform: scale(.85); opacity: 0; pointer-events: none; }

/* ——————————————————————————————————————————— en-têtes de vue */
.eyebrow {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); letter-spacing: .005em;
}
.eyebrow .ic { width: 16px; height: 16px; color: var(--accent-l); }
.h-xl {
  margin: 0; font-size: clamp(34px, 4.4vw, 50px); line-height: 1.04; font-weight: 750; letter-spacing: -.038em;
  text-wrap: balance;
}
.grad-dot, .grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { margin: 12px 0 0; font-size: 16.5px; color: var(--text-2); max-width: 46ch; text-wrap: pretty; }
.sub b { font-weight: 650; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 34px 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.group-title .ic { width: 16px; height: 16px; }

/* Héros « Aujourd'hui » */
.hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; margin-bottom: 30px; }
.glass-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-2);
}
.hero-ring { position: relative; padding: 16px; border-radius: 30px; display: grid; place-items: center; }
.hero-ring::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), rgba(139, 92, 246, .0), rgba(139, 92, 246, .55), rgba(6, 182, 212, .5), rgba(139, 92, 246, 0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: .0; transition: opacity .6s;
}
.hero-ring.all-done::before { opacity: 1; animation: spin-ang 6s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-ang { to { --ang: 360deg; } }
.ring { position: relative; width: var(--size); height: var(--size); }
.ring svg { overflow: visible; }
.ring-track { stroke: var(--ring-track); }
.ring-bar { transition: stroke-dashoffset 1.3s var(--spring); filter: drop-shadow(0 0 6px rgba(139, 92, 246, .45)); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center strong { font-size: 30px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.ring-center strong span { font-size: 17px; color: var(--text-3); font-weight: 600; letter-spacing: -.02em; }
.ring-center small { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.all-done .ring-center small { color: var(--accent-l); }

/* ——————————————————————————————————————————— sections & listes */
.sec { margin-top: 26px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 10px; min-height: 34px; }
.sec-title-wrap, .sec-toggle { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sec-toggle { padding: 4px 8px 4px 0; border-radius: 10px; }
.sec-toggle:hover h2 { color: var(--text); }
.sec-chev { color: var(--text-3); transition: transform .3s var(--spring); }
.sec-chev .ic { width: 16px; height: 16px; }
.sec-toggle[aria-expanded="false"] .sec-chev { transform: rotate(-90deg); }
.sec-ic {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: rgba(139, 92, 246, .14); color: var(--accent-l);
}
.sec-ic .ic { width: 15px; height: 15px; }
.sec h2 { margin: 0; font-size: 15.5px; font-weight: 680; letter-spacing: -.012em; color: var(--text); transition: color .2s; }
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-3); background: var(--fill);
}
.sec-late .sec-ic { background: rgba(244, 63, 94, .14); color: var(--late); }
.sec-late h2 { color: var(--late); }
.sec-late .count { background: rgba(244, 63, 94, .14); color: var(--late); }
.sec-done .sec-ic { background: rgba(52, 211, 153, .12); color: var(--ok); }

.list {
  padding: 5px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-1);
}
.list-late {
  background: linear-gradient(180deg, rgba(244, 63, 94, .085), rgba(244, 63, 94, .035));
  border-color: var(--late-line);
  box-shadow: inset 0 1px 0 rgba(255, 180, 190, .06), 0 10px 30px -18px rgba(244, 63, 94, .5);
}

/* Ligne de tâche */
.trow {
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px;
  min-height: 54px; padding: 0 6px 0 4px;
  border-radius: 14px;
  transition: background .2s, box-shadow .2s, opacity .3s, height .32s var(--spring), min-height .32s var(--spring), transform .32s var(--spring);
}
@media (hover: hover) { .trow:hover { background: var(--card-hover); } }
.trow.sel { background: var(--card-hover); box-shadow: inset 0 0 0 1.5px rgba(139, 92, 246, .55); }
.trow-main {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  min-width: 0; min-height: 54px; padding: 9px 4px; text-align: left; border-radius: 10px;
}
.trow-main:focus-visible { outline-offset: -2px; }
.trow-title {
  align-self: flex-start; max-width: 100%;
  font-size: 15px; font-weight: 520; line-height: 1.35; color: var(--text); overflow-wrap: anywhere;
  text-decoration: line-through 1.5px transparent;
  transition: text-decoration-color .4s var(--spring), color .35s;
}
.done .trow-title, .done .kcard-title { color: var(--text-3); text-decoration-color: currentColor; }
.trow-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.trow-go { color: var(--text-3); opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .3s var(--spring); padding-right: 4px; }
.trow-go .ic { width: 16px; height: 16px; }
@media (hover: hover) { .trow:hover .trow-go { opacity: .7; transform: none; } }
.trow.completing { background: linear-gradient(90deg, rgba(139, 92, 246, .1), transparent 70%); }
.trow.leaving { opacity: 0; min-height: 0; overflow: hidden; transform: translateX(14px); }

/* Case à cocher */
.check {
  position: relative; flex: none;
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
}
.check::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%;
  border: 1.8px solid var(--check-line);
  grid-area: 1 / 1;
  transition: background .3s var(--spring), border-color .25s, box-shadow .3s, transform .3s var(--spring-bounce);
}
.check svg {
  grid-area: 1 / 1; z-index: 1; width: 14px; height: 14px;
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 18; stroke-dashoffset: 18; transition: stroke-dashoffset .35s .06s var(--spring);
}
.pr1 > .check::before { border-color: rgba(96, 165, 250, .75); }
.pr2 > .check::before { border-color: rgba(251, 191, 36, .85); }
.pr3 > .check::before { border-color: rgba(251, 113, 133, .95); background: rgba(244, 63, 94, .08); }
@media (hover: hover) {
  .check:hover::before { border-color: var(--accent-l); background: rgba(139, 92, 246, .1); transform: scale(1.06); }
  .check:not([aria-pressed="true"]):hover svg { stroke: var(--accent-l); stroke-dashoffset: 0; opacity: .55; }
}
.check[aria-pressed="true"]::before {
  border-color: transparent; background: var(--grad);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, .13), 0 4px 12px -2px rgba(99, 102, 241, .7);
}
.check[aria-pressed="true"] svg { stroke-dashoffset: 0; }
.completing .check::before { animation: check-pop .5s var(--spring-bounce); }
@keyframes check-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.check.sm { width: 36px; height: 36px; }
.check.sm::before { width: 19px; height: 19px; }
.check.sm svg { width: 12px; height: 12px; }
.check.lg { width: 44px; height: 44px; margin: -4px 0 0 -8px; }
.check.lg::before { width: 26px; height: 26px; }

/* Puces */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 560; line-height: 1; white-space: nowrap;
  color: var(--text-2); background: var(--fill); border: 1px solid var(--line);
}
.chip .ic { width: 12.5px; height: 12.5px; }
.chip-due.late { color: var(--late); background: var(--late-bg); border-color: var(--late-line); }
.chip-due.today { color: var(--indigo-l); background: rgba(99, 102, 241, .12); border-color: rgba(129, 140, 248, .28); }
.chip-due.soon { color: var(--warn); background: rgba(251, 191, 36, .09); border-color: rgba(251, 191, 36, .22); }
.chip-prio.p1 { color: #60a5fa; background: rgba(59, 130, 246, .1); border-color: rgba(96, 165, 250, .25); }
.chip-prio.p2 { color: var(--warn); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .25); }
.chip-prio.p3 { color: var(--late); background: var(--late-bg); border-color: var(--late-line); font-weight: 700; }
[data-theme="light"] .chip-prio.p1 { color: #1d4ed8; }
.chip-proj { color: var(--ct); background: rgb(var(--c) / .1); border-color: rgb(var(--c) / .24); max-width: 220px; }
.chip-proj .dot { display: none; }
.kick-proj .dot { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--c)); flex: none; }
.chip-proj { overflow: hidden; text-overflow: ellipsis; }
.chip-doing { color: var(--accent-ll); background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .3); }
.chip-doing .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-l); animation: pulse-dot 1.8s ease-in-out infinite; }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 4px rgba(167, 139, 250, .2); opacity: .7; } }
.chip-ghost { background: transparent; border-color: transparent; padding: 0 4px; color: var(--text-3); }
.chip-status.s-active { color: var(--ok); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .25); }
.chip-status.s-paused { color: var(--warn); background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .25); }
.chip-status.s-done { color: var(--indigo-l); background: rgba(99, 102, 241, .1); border-color: rgba(129, 140, 248, .25); }

.day-sep { display: flex; align-items: baseline; gap: 8px; padding: 12px 12px 2px 16px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.day-sep:first-child { padding-top: 8px; }
.day-sep small { font-weight: 500; letter-spacing: 0; opacity: .7; }

.add-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 0 14px; border-radius: 13px;
  color: var(--text-3); font-size: 14.5px; font-weight: 500;
  transition: background .2s, color .2s;
}
.add-row .ic { width: 18px; height: 18px; margin: 0 2px 0 3px; padding: 2px; border-radius: 50%; border: 1.6px dashed currentColor; }
.add-row span { flex: 1; text-align: left; }
.add-row:hover { color: var(--text); background: var(--fill); }
.add-row:hover .ic { color: var(--accent-l); }

/* ——————————————————————————————————————————— barre d'outils / champs */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; }
.search-field {
  flex: 1 1 280px;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 10px 0 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-3);
  box-shadow: inset 0 1px 0 var(--hi);
  transition: border-color .2s, box-shadow .25s;
}
.search-field .ic { width: 18px; height: 18px; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 15px; color: var(--text); }
.search-field input::placeholder { color: var(--text-3); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field:focus-within { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.select-wrap {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 0 0 12px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--text-3);
  transition: border-color .2s, box-shadow .25s;
}
.select-wrap .ic { width: 17px; height: 17px; }
.select-wrap select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--text);
  height: 100%; padding: 0 36px 0 0; font-size: 14px; font-weight: 550; max-width: 240px; cursor: pointer;
}
.select-wrap select option { background: var(--card-solid); color: var(--text); }
.select-wrap .sel-chev { position: absolute; right: 11px; width: 16px; height: 16px; pointer-events: none; }
.select-wrap:focus-within { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.select-wrap.full { display: flex; width: 100%; }
.select-wrap.full select { flex: 1; max-width: none; }
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 13px;
  background: var(--card); border: 1px solid var(--line);
}
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 44px; height: 36px; padding: 0 12px; border-radius: 10px;
  font-size: 13px; font-weight: 650; color: var(--text-3);
  transition: background .25s var(--spring), color .2s, box-shadow .25s;
}
.seg-btn .ic { width: 14px; height: 14px; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { color: var(--text); background: var(--fill-2); box-shadow: inset 0 1px 0 var(--hi), 0 1px 3px rgba(0, 0, 0, .25); }
[data-theme="light"] .seg-btn.on { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 64, .1), 0 2px 8px -2px rgba(16, 24, 64, .1); }
.seg-btn.p1.on, .seg-btn.p1:hover { color: #60a5fa; }
.seg-btn.p2.on, .seg-btn.p2:hover { color: var(--warn); }
.seg-btn.p3.on, .seg-btn.p3:hover { color: var(--late); }
.seg-btn.st-doing.on { color: var(--accent-ll); }
.seg-btn.st-done.on { color: var(--ok); }
.seg-full { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.seg-full .seg-btn { padding: 0 6px; min-width: 0; }

/* ——————————————————————————————————————————— projets */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.pcard {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 214px; padding: 18px 18px 16px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-2);
  transition: transform .4s var(--spring), box-shadow .4s var(--spring), border-color .3s;
}
.pcard:not(.pcard-new) { background: radial-gradient(120% 90% at 0% 0%, rgb(var(--c) / .17), transparent 58%), var(--card); }
@media (hover: hover) {
  .pcard:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 var(--hi), 0 2px 4px rgba(0, 0, 0, .2), 0 22px 44px -20px rgb(var(--c, 139 92 246) / .55), 0 30px 60px -30px rgba(0, 0, 0, .6); }
}
.pcard:active { transform: translateY(-1px) scale(.99); }
.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.emoji-tile {
  display: grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 14px; font-size: 23px; line-height: 1;
  background: linear-gradient(140deg, rgb(var(--c) / .42), rgb(var(--c) / .12));
  border: 1px solid rgb(var(--c) / .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 20px -10px rgb(var(--c) / .8);
}
.emoji-tile.xl { width: 66px; height: 66px; border-radius: 20px; font-size: 34px; }
button.emoji-tile { transition: transform .35s var(--spring-bounce); }
button.emoji-tile:hover { transform: rotate(-6deg) scale(1.06); }
.pcard-ring, .phero-ring { position: relative; display: grid; place-items: center; }
.pcard-ring .num, .phero-ring .num { position: absolute; font-size: 13px; font-weight: 700; letter-spacing: -.02em; }
.pcard-ring .num small, .phero-ring .num small { font-size: .7em; color: var(--text-3); margin-left: 1px; }
.phero-ring .num { font-size: 21px; }
:is(.pcard, .view-project) .ring { --ring-a: rgb(var(--c)); --ring-b: rgb(var(--c)); --ring-c: var(--ct); }
:is(.pcard, .view-project) .ring-bar { filter: drop-shadow(0 0 5px rgb(var(--c) / .55)); }
.pcard-name { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.022em; line-height: 1.25; }
.pcard-desc {
  margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-desc.muted { color: var(--text-3); font-style: italic; }
.pbar { position: relative; height: 5px; margin: auto 0 0; border-radius: 3px; background: var(--ring-track); overflow: hidden; margin-top: 18px; }
.pbar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, rgb(var(--c)), var(--ct)); box-shadow: 0 0 10px rgb(var(--c) / .6); transition: width 1s var(--spring); }
.pcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.pcard-left { margin-right: auto; font-size: 13px; font-weight: 550; color: var(--text-2); }
.pcard.is-paused { filter: saturate(.55); opacity: .82; }
.pcard.is-done { opacity: .72; }
.pcard-new {
  align-items: center; justify-content: center; gap: 12px;
  color: var(--text-3); font-weight: 600; font-size: 14.5px;
  background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none;
}
.pcard-new:hover { color: var(--text); border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .05); }
.plus-ring {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--fill); border: 1px solid var(--line-2); transition: transform .4s var(--spring-bounce), background .3s, color .3s;
}
.pcard-new:hover .plus-ring { transform: rotate(90deg) scale(1.08); background: var(--grad); color: #fff; border-color: transparent; }

/* Détail d'un projet */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: -8px 0 14px -6px; padding: 6px 10px 6px 6px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.back-link:hover { color: var(--text); background: var(--fill); }
.back-link .ic { width: 18px; height: 18px; }
.phero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 26px 26px 18px; border-radius: var(--r-xl);
  background: var(--card); border: 1px solid rgb(var(--c) / .25);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-2), 0 30px 60px -40px rgb(var(--c) / .7);
}
.phero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 140% at 0% 0%, rgb(var(--c) / .38), transparent 55%),
    radial-gradient(60% 120% at 100% 0%, rgb(var(--c) / .14), transparent 60%),
    linear-gradient(180deg, rgb(var(--c) / .06), transparent);
}
.phero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.2px);
  background-size: 22px 22px; opacity: .06;
  -webkit-mask: linear-gradient(120deg, #000, transparent 60%); mask: linear-gradient(120deg, #000, transparent 60%);
}
.phero-main { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.phero-text { min-width: 0; }
.title-input {
  display: block; width: 100%; min-width: 0; padding: 2px 8px; margin-left: -8px; resize: none; overflow: hidden; line-height: 1.08;
  background: transparent; border: 1px solid transparent; border-radius: 12px; color: var(--text);
  font-size: clamp(28px, 3.6vw, 42px);
  transition: background .2s, border-color .2s;
}
.title-input:hover { background: var(--fill); }
.title-input:focus { background: var(--fill); border-color: var(--line-2); }
.phero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.desc-input {
  display: block; width: 100%; margin: 18px 0 0; padding: 10px 12px; resize: none; overflow: hidden;
  background: transparent; border: 1px solid transparent; border-radius: 14px;
  color: var(--text-2); font-size: 15px; line-height: 1.55;
  transition: background .2s, border-color .2s;
}
.desc-input::placeholder { color: var(--text-3); }
.desc-input:hover { background: var(--fill); }
.desc-input:focus { background: var(--fill); border-color: var(--line-2); color: var(--text); }
.phero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Kanban */
.kboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 22px; align-items: start; }
.kcol {
  display: flex; flex-direction: column; min-height: 240px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--hi);
  transition: border-color .2s, background .2s, box-shadow .3s;
}
.kcol.drop-target { border-color: rgba(139, 92, 246, .55); background: rgba(139, 92, 246, .06); box-shadow: 0 0 0 4px rgba(139, 92, 246, .1), inset 0 1px 0 var(--hi); }
.kcol-head { display: flex; align-items: center; gap: 9px; padding: 4px 4px 10px 8px; }
.kcol-head h3 { margin: 0; font-size: 14px; font-weight: 680; letter-spacing: -.01em; }
.kcol-head .icon-btn { margin-left: auto; }
.kdot { width: 9px; height: 9px; border-radius: 50%; }
.k-todo .kdot { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .18); }
.k-doing .kdot { background: var(--accent-l); box-shadow: 0 0 0 3px rgba(167, 139, 250, .2), 0 0 10px rgba(167, 139, 250, .8); }
.k-done .kdot { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.kcol-list { display: flex; flex-direction: column; gap: 7px; flex: 1; min-height: 60px; }
.kcard {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 2px;
  padding: 3px 12px 3px 3px; border-radius: 14px;
  background: var(--card-solid); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: transform .25s var(--spring), box-shadow .25s, border-color .2s;
}
[data-theme="dark"] .kcard { background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .025)), #0e1019; }
@media (hover: hover) { .kcard:hover { transform: translateY(-1px); border-color: var(--line-2); box-shadow: var(--shadow-2); } }
.kcard .check { margin-top: 1px; }
.kcard-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 0 10px 0; text-align: left; cursor: inherit; }
.kcard-title { align-self: flex-start; max-width: 100%; font-size: 14px; font-weight: 540; line-height: 1.38; overflow-wrap: anywhere; text-decoration: line-through 1.5px transparent; transition: text-decoration-color .4s var(--spring), color .3s; }
.kcard.pr3 { box-shadow: inset 3px 0 0 rgba(251, 113, 133, .85), var(--shadow-1); }
.kcard.pr2 { box-shadow: inset 3px 0 0 rgba(251, 191, 36, .8), var(--shadow-1); }
.kcard.dragging-src { display: none; }
.kcard-ph { border-radius: 14px; border: 1.5px dashed rgba(139, 92, 246, .55); background: rgba(139, 92, 246, .07); transition: height .2s; }
.kcard-ghost {
  position: fixed !important; left: 0; top: 0; z-index: 1000; margin: 0;
  pointer-events: none; cursor: grabbing;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 50px -10px rgba(0, 0, 0, .65), 0 0 0 1px rgba(139, 92, 246, .45) !important;
  transition: none;
  will-change: transform;
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.kcol-empty {
  display: grid; place-items: center; min-height: 72px; padding: 14px; text-align: center;
  font-size: 13px; color: var(--text-3); border: 1.5px dashed var(--line); border-radius: 13px;
}
.kcol-list:has(.kcard-ph) .kcol-empty { display: none; }

/* ——————————————————————————————————————————— notes */
.masonry { columns: 4 232px; column-gap: 14px; }
.note {
  position: relative; display: block;
  break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 14px;
  padding: 16px 16px 8px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-1);
  transition: transform .35s var(--spring), box-shadow .35s var(--spring), border-color .2s;
}
.note:not(.nc-none) {
  background: linear-gradient(160deg, rgb(var(--c) / .22), rgb(var(--c) / .07) 70%), var(--card);
  border-color: rgb(var(--c) / .3);
}
[data-theme="light"] .note:not(.nc-none) { background: linear-gradient(160deg, rgb(var(--c) / .18), rgb(var(--c) / .06) 70%), rgba(255, 255, 255, .8); }
@media (hover: hover) { .note:hover { transform: translateY(-2px) rotate(-.25deg); box-shadow: inset 0 1px 0 var(--hi), var(--shadow-2); } }
.note.pinned { padding-top: 18px; }
.pin-badge { position: absolute; top: 10px; right: 12px; color: var(--text-3); }
.pin-badge .ic { width: 15px; height: 15px; transform: rotate(30deg); }
.note:not(.nc-none) .pin-badge { color: var(--ct); }
.note-content {
  font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 22em; overflow: hidden; cursor: text; border-radius: 8px;
  -webkit-mask: linear-gradient(#000 calc(100% - 3em), transparent); mask: linear-gradient(#000 calc(100% - 3em), transparent);
  -webkit-mask-size: 100% max(100%, 22em); mask-size: 100% max(100%, 22em);
}
.note.pinned .note-content { padding-right: 16px; }
.note-content a { color: var(--indigo-l); text-decoration: underline; text-decoration-color: rgba(165, 180, 252, .4); text-underline-offset: 2px; }
.note-edit {
  display: block; width: 100%; min-height: 80px; padding: 0; resize: none; overflow: hidden;
  background: transparent; border: 0; color: var(--text); font-size: 14.5px; line-height: 1.55;
}
.note.editing { box-shadow: 0 0 0 2px rgba(139, 92, 246, .5), var(--shadow-2); }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 6px; margin-top: 10px; min-height: 32px; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; flex: 1 1 88px; min-width: 0; font-size: 12px; color: var(--text-3); }
.note-meta time { white-space: nowrap; }
.note-meta .chip { max-width: 130px; }
.note-actions { display: flex; gap: 0; margin-left: auto; opacity: 0; transition: opacity .2s; }
.note:hover .note-actions, .note:focus-within .note-actions, .note.editing .note-actions { opacity: 1; }
@media (hover: none) { .note-actions { opacity: .75; } }
.note.flash { animation: note-flash 1.6s var(--spring); }
@keyframes note-flash { 0%, 100% { box-shadow: inset 0 1px 0 var(--hi), var(--shadow-1); } 25%, 60% { box-shadow: 0 0 0 3px rgba(139, 92, 246, .65), 0 0 40px rgba(139, 92, 246, .35); } }
.color-pop {
  position: absolute; z-index: 5; right: 8px; bottom: 46px;
  display: flex; flex-wrap: wrap; gap: 7px; padding: 9px; max-width: 220px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-3);
  animation: pop-in .25s var(--spring);
}
.swatch {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: rgb(var(--c)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  transition: transform .25s var(--spring-bounce), box-shadow .2s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgb(var(--c, 160 160 180)); }
.sw-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); position: relative; }
.sw-none::after { content: ""; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 1.5px; background: var(--text-3); transform: rotate(45deg); }
.sw-none.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text-3); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches.lg .swatch, .swatch.lg { width: 34px; height: 34px; }
.composer {
  margin: 8px 0 6px; padding: 14px 14px 10px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); box-shadow: inset 0 1px 0 var(--hi), var(--shadow-1);
  transition: border-color .2s, box-shadow .25s, background .3s;
}
.composer:not(.nc-none) { background: linear-gradient(160deg, rgb(var(--c) / .16), rgb(var(--c) / .05) 70%), var(--card); border-color: rgb(var(--c) / .3); }
.composer:focus-within { box-shadow: 0 0 0 4px rgba(139, 92, 246, .12), var(--shadow-2); border-color: rgba(139, 92, 246, .4); }
.composer textarea { display: block; width: 100%; min-height: 48px; resize: none; overflow: hidden; border: 0; background: transparent; font-size: 15px; line-height: 1.5; padding: 2px 2px 6px; }
.composer textarea::placeholder { color: var(--text-3); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.composer-foot .btn-primary { margin-left: auto; }
.composer .swatch { width: 20px; height: 20px; }
.view-notes .group-title:first-of-type { margin-top: 28px; }
.view-notes .masonry { margin-top: 0; }
.view-notes .composer + .masonry { margin-top: 22px; }

/* ——————————————————————————————————————————— états vides */
.empty-card { margin-top: 18px; }
.empty-card.slim .empty { padding: 18px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 20px 30px; }
.empty .illus { width: 168px; height: 126px; margin-bottom: 6px; }
.empty h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.empty p { margin: 6px 0 0; max-width: 380px; color: var(--text-2); font-size: 14.5px; text-wrap: pretty; }
.empty .btn-primary, .empty .btn-ghost { margin-top: 18px; }
.il-float { animation: il-float 6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.il-twinkle { animation: il-twinkle 3s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.il-twinkle.d2 { animation-delay: 1.4s; }
.il-draw { stroke-dasharray: 40; stroke-dashoffset: 40; animation: il-draw 1s .3s var(--spring) forwards; }
@keyframes il-float { 50% { transform: translateY(-5px); } }
@keyframes il-twinkle { 50% { opacity: .25; transform: scale(.6); } }
@keyframes il-draw { to { stroke-dashoffset: 0; } }

/* ——————————————————————————————————————————— palette */
.palette-wrap { position: fixed; inset: 0; z-index: 200; }
.scrim {
  position: fixed; inset: 0; background: var(--scrim);
  -webkit-backdrop-filter: blur(5px) saturate(120%); backdrop-filter: blur(5px) saturate(120%);
  opacity: 0; transition: opacity .3s;
}
.open > .scrim { opacity: 1; }
.palette {
  position: fixed; left: 50%; top: 13vh;
  width: min(680px, calc(100% - 32px));
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--line-2);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-3), 0 0 0 1px rgba(0, 0, 0, .2);
  overflow: hidden;
  opacity: 0; transform: translate(-50%, -10px) scale(.97);
  transition: opacity .22s, transform .35s var(--spring);
}
.palette::before {
  content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, .9), rgba(103, 232, 249, .8), transparent);
}
.palette-wrap.open .palette { opacity: 1; transform: translate(-50%, 0) scale(1); }
.palette.saved { animation: saved-flash .6s var(--spring); }
@keyframes saved-flash { 30% { box-shadow: inset 0 1px 0 var(--hi), var(--shadow-3), 0 0 0 2px rgba(52, 211, 153, .6), 0 0 40px rgba(52, 211, 153, .25); } }
.pal-input-row { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; }
.pal-ic {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: var(--grad); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -6px rgba(99, 102, 241, .8);
  transition: transform .35s var(--spring-bounce);
}
.pal-ic .ic { width: 19px; height: 19px; stroke-width: 2.2; }
.palette[data-type="note"] .pal-ic { background: linear-gradient(135deg, #f59e0b, #f472b6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -6px rgba(244, 114, 182, .8); }
.palette[data-type="project"] .pal-ic { background: linear-gradient(135deg, #10b981, #06b6d4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 16px -6px rgba(6, 182, 212, .8); }
.palette[data-type="search"] .pal-ic { background: var(--fill-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
#pal-input {
  flex: 1; min-width: 0; height: 40px; border: 0; background: transparent;
  font-size: 19px; font-weight: 500; letter-spacing: -.012em; color: var(--text);
}
#pal-input::placeholder { color: var(--text-3); font-weight: 450; }
.pal-close { display: none; }
.pal-modes { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; }
.pal-modes::-webkit-scrollbar { display: none; }
.pal-mode {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 32px; padding: 0 11px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-3);
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.pal-mode .ic { width: 15px; height: 15px; }
.pal-mode:hover { color: var(--text); background: var(--fill); }
.pal-mode.on { color: var(--text); background: rgba(139, 92, 246, .16); border-color: rgba(139, 92, 246, .32); }
.pal-chips:empty { display: none !important; }
.pal-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 48px; padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.pal-hint { font-size: 12.5px; color: var(--text-3); line-height: 2; }
.pal-hint code { font-size: 11.5px; padding: 1px 5px; margin: 0 1px; }
.pchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 10px;
  font-size: 13px; font-weight: 620;
  background: var(--fill); border: 1px solid var(--line-2); color: var(--text);
  animation: pop-in .3s var(--spring-bounce);
}
.pchip .ic { width: 14px; height: 14px; }
.pchip small { font-weight: 500; color: var(--text-3); margin-left: 2px; }
.pc-date { color: var(--indigo-l); background: rgba(99, 102, 241, .13); border-color: rgba(129, 140, 248, .32); }
.pc-prio.p1 { color: #60a5fa; background: rgba(59, 130, 246, .12); border-color: rgba(96, 165, 250, .3); }
.pc-prio.p2 { color: var(--warn); background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.pc-prio.p3 { color: var(--late); background: var(--late-bg); border-color: var(--late-line); }
.pc-proj { color: var(--ct); background: rgb(var(--c) / .13); border-color: rgb(var(--c) / .32); }
.pc-proj .dot { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); }
.pc-miss { color: var(--warn); border-style: dashed; background: transparent; }
.pc-type { color: var(--accent-ll); background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .32); }
.pal-list { max-height: min(46vh, 420px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 8px; border-top: 1px solid var(--line); }
.pal-group { padding: 10px 10px 5px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.pal-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 6px 10px; border-radius: 12px; cursor: pointer;
  transition: background .12s;
}
.pal-item.on { background: var(--fill-2); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3); }
.pal-item-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: none; background: var(--fill); color: var(--text-2); font-size: 16px; }
.pal-item-ic .ic { width: 16px; height: 16px; }
.pal-item-ic.emoji { background: rgb(var(--c) / .16); }
.pal-item-ic.is-done { color: var(--ok); }
.pal-item-ic:is(.nc-violet, .nc-blue, .nc-cyan, .nc-green, .nc-amber, .nc-orange, .nc-rose, .nc-slate) { background: rgb(var(--c) / .18); color: var(--ct); }
.pal-item.on .pal-item-ic { color: var(--text); }
.pal-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.pal-item-sub { display: flex; gap: 10px; flex: 0 1 auto; max-width: 45%; overflow: hidden; white-space: nowrap; font-size: 12.5px; }
.pal-item-sub .muted { overflow: hidden; text-overflow: ellipsis; }
.pal-item mark { background: rgba(139, 92, 246, .3); color: inherit; border-radius: 3px; padding: 0 1px; }
.pal-empty { display: flex; align-items: center; gap: 10px; padding: 18px 12px; color: var(--text-3); font-size: 14px; }
.pal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .14); font-size: 12px; color: var(--text-3);
}
[data-theme="light"] .pal-foot { background: rgba(15, 23, 42, .025); }
.pal-foot kbd { margin: 0 3px 0 8px; }
.pal-foot kbd:first-child { margin-left: 0; }
.pal-keys, .pal-search-keys { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-search-keys { display: none; }
.pal-foot.is-search .pal-keys, .pal-foot.is-search .pal-btns { display: none; }
.pal-foot.is-search .pal-search-keys { display: block; padding: 6px 0; }
.pal-btns { display: flex; gap: 8px; flex: none; }

/* ——————————————————————————————————————————— tiroir */
.drawer-wrap { position: fixed; inset: 0; z-index: 150; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px;
  width: min(460px, calc(100% - 24px));
  display: flex; flex-direction: column;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-3);
  transform: translateX(calc(100% + 30px));
  transition: transform .45s var(--spring);
  overflow: hidden;
}
.drawer-wrap.open .drawer { transform: none; }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 4px 20px; }
.sheet-kicker { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); min-width: 0; }
.sheet-kicker .ic { width: 15px; height: 15px; }
.kick-proj { display: inline-flex; align-items: center; gap: 5px; color: var(--ct); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 22px; }
.title-row { display: flex; align-items: flex-start; gap: 6px; }
.d-title {
  display: block; width: 100%; padding: 4px 0; resize: none; overflow: hidden;
  background: transparent; border: 0; color: var(--text);
  font-size: 22px; font-weight: 680; line-height: 1.28; letter-spacing: -.022em;
}
.d-title::placeholder { color: var(--text-3); }
.d-title.done { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.field { margin-top: 20px; }
.label { display: block; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.label em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  height: 36px; padding: 0 13px; border-radius: 11px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: var(--fill); border: 1px solid var(--line);
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--spring);
}
.pill:hover { color: var(--text); border-color: var(--line-2); }
.pill:active { transform: scale(.95); }
.pill.on { color: var(--text); background: rgba(139, 92, 246, .18); border-color: rgba(139, 92, 246, .45); }
.date-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.date-field {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; margin-top: 8px; border-radius: 12px;
  background: var(--fill); border: 1px solid var(--line); color: var(--text-3);
}
.date-row .date-field { margin-top: 0; }
.date-field .ic { width: 17px; height: 17px; }
.date-field input { border: 0; background: transparent; color: var(--text); font-size: 14.5px; min-height: 30px; }
.date-field input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
[data-theme="dark"] .date-field input::-webkit-calendar-picker-indicator { filter: invert(1); }
.date-field:focus-within { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.d-notes {
  display: block; width: 100%; min-height: 96px; padding: 12px 14px; resize: none; overflow: hidden;
  background: var(--fill); border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); font-size: 14.5px; line-height: 1.55;
  transition: border-color .2s, box-shadow .25s;
}
.d-notes::placeholder { color: var(--text-3); }
.d-notes:focus { border-color: rgba(139, 92, 246, .55); box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.sheet-foot.sticky { position: sticky; bottom: -22px; margin: 22px -20px -22px; padding: 14px 20px 18px; background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.proj-preview {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; margin-top: 4px;
  background: radial-gradient(120% 140% at 0% 0%, rgb(var(--c) / .3), transparent 60%), var(--fill);
  border: 1px solid rgb(var(--c) / .28);
  transition: background .4s;
}
.proj-preview .d-title { font-size: 21px; }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emo {
  height: 42px; border-radius: 11px; font-size: 21px; line-height: 1;
  background: var(--fill); border: 1px solid transparent;
  transition: transform .25s var(--spring-bounce), background .2s, border-color .2s;
}
.emo:hover { transform: scale(1.1); }
.emo.on { background: rgba(139, 92, 246, .18); border-color: rgba(139, 92, 246, .5); }
.emo-input { grid-column: span 2; height: 42px; border-radius: 11px; text-align: center; background: var(--fill); border: 1px dashed var(--line-2); color: var(--text); font-size: 15px; }
.emo-input:focus { border-color: rgba(139, 92, 246, .55); }

/* ——————————————————————————————————————————— toasts */
.toasts {
  position: fixed; z-index: 300; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100% - 24px); pointer-events: none;
}
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; max-width: 520px; padding: 7px 8px 7px 10px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--line-2); border-radius: 15px;
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-3);
  font-size: 14px; font-weight: 550;
  animation: toast-in .45s var(--spring-bounce);
}
.toast.out { animation: toast-out .25s ease-in forwards; }
.toast-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; flex: none; background: rgba(139, 92, 246, .16); color: var(--accent-l); }
.toast-ic .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.toast-success .toast-ic { background: rgba(52, 211, 153, .14); color: var(--ok); }
.toast-error .toast-ic { background: rgba(244, 63, 94, .14); color: var(--late); }
.toast-error { border-color: var(--late-line); }
.toast-msg { padding-right: 6px; }
.toast-btn {
  height: 34px; padding: 0 12px; border-radius: 10px; flex: none;
  font-size: 13.5px; font-weight: 700; color: var(--accent-ll); background: var(--fill-2);
  transition: background .2s;
}
.toast-btn:hover { background: rgba(139, 92, 246, .22); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--grad); transform-origin: left; animation: bar-shrink linear forwards; opacity: .8; }
.toast:hover .toast-bar { animation-play-state: paused; }
@keyframes bar-shrink { to { transform: scaleX(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }

/* Particules & confettis */
.particle { position: fixed; z-index: 400; border-radius: 50%; pointer-events: none; box-shadow: 0 0 6px currentColor; }
.confetti { position: fixed; z-index: 400; pointer-events: none; }

/* Bannière hors ligne */
.offline {
  position: fixed; z-index: 250; left: 50%; top: calc(var(--safe-t) + 10px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--warn); white-space: nowrap;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid rgba(251, 191, 36, .3); box-shadow: var(--shadow-2);
  animation: drop-in .45s var(--spring-bounce);
}
.offline .ic { width: 16px; height: 16px; }
@keyframes drop-in { from { opacity: 0; transform: translate(-50%, -20px); } }

/* ——————————————————————————————————————————— connexion */
.login {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px);
  overflow-y: auto;
}
.login-card {
  position: relative; width: min(400px, 100%);
  padding: 40px 30px 26px; border-radius: 30px; text-align: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--hi), var(--shadow-3);
  animation: rise .8s var(--spring) both;
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(160deg, rgba(167, 139, 250, .55), transparent 35%, transparent 65%, rgba(103, 232, 249, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.login-card.shake { animation: shake .45s; }
.login-card.success { transform: scale(.98); opacity: .0; transition: transform .38s var(--spring), opacity .38s; }
.login-logo { position: relative; width: 76px; height: 76px; margin: 0 auto 20px; }
.login-logo img { position: relative; border-radius: 22px; box-shadow: 0 14px 34px -10px rgba(99, 102, 241, .9), inset 0 1px 0 rgba(255, 255, 255, .3); animation: logo-float 6s ease-in-out infinite; }
.logo-halo {
  position: absolute; inset: -18px; border-radius: 50%;
  background: conic-gradient(from 0deg, #8b5cf6, #6366f1, #06b6d4, #8b5cf6);
  filter: blur(26px); opacity: .55; animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes logo-float { 50% { transform: translateY(-4px); } }
.login-title { margin: 0; font-size: 36px; font-weight: 780; letter-spacing: -.045em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-tag { margin: 6px 0 26px; color: var(--text-2); font-size: 15px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.pw-field {
  display: flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 6px 0 16px; border-radius: 16px;
  background: var(--fill); border: 1px solid var(--line-2); color: var(--text-3);
  transition: border-color .2s, box-shadow .25s;
}
.pw-field:focus-within { border-color: rgba(139, 92, 246, .6); box-shadow: 0 0 0 4px rgba(139, 92, 246, .16); }
.pw-ic .ic { width: 18px; height: 18px; }
.pw-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; color: var(--text); letter-spacing: .02em; }
.pw-field input::placeholder { color: var(--text-3); letter-spacing: 0; }
.pw-eye { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--text-3); }
.pw-eye:hover { color: var(--text); background: var(--fill); }
.pw-eye .ic { width: 19px; height: 19px; }
#login-btn .spinner { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
#login-btn.loading .spinner { display: block; }
#login-btn.loading span:first-child { opacity: .7; }
.login-msg { min-height: 20px; margin: 2px 0 0; font-size: 13.5px; font-weight: 550; color: var(--late); }
.login-setup { padding: 16px; border-radius: 16px; background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .28); color: var(--text-2); font-size: 14.5px; }
.login-setup p { margin: 4px 0; }
.login-setup strong { color: var(--text); }
.login-foot { margin: 20px 0 0; font-size: 12.5px; color: var(--text-3); animation: rise .8s .15s var(--spring) both; }

/* ——————————————————————————————————————————— squelette */
.boot { position: fixed; inset: 0; display: flex; gap: 0; padding: 12px; }
.boot-side { width: var(--side-w); padding: 18px 14px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.boot-main { flex: 1; max-width: 1080px; margin: 0 auto; padding: 34px 56px; display: flex; flex-direction: column; gap: 14px; }
.sk {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 40%, var(--fill) 80%);
  background-size: 250% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
.sk-logo { width: 110px; height: 30px; margin-bottom: 12px; }
.sk-line { height: 14px; }
.sk-line.small { height: 12px; }
.sk-title { width: 46%; height: 48px; border-radius: 14px; }
.sk-card { height: 180px; border-radius: 20px; margin-top: 18px; }
.sk-card.short { height: 110px; margin-top: 0; }
.w30 { width: 30%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ——————————————————————————————————————————— animations communes */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.shake { animation: shake .45s; }
.stagger :is(.hero, .view-head, .toolbar, .composer, .phero, .back-link) { animation: rise .55s var(--spring) both; }
.stagger .sec { animation: rise .55s var(--spring) both; }
.stagger .sec:nth-of-type(2) { animation-delay: 60ms; }
.stagger .sec:nth-of-type(3) { animation-delay: 120ms; }
.stagger .sec:nth-of-type(n+4) { animation-delay: 170ms; }
.stagger :is(.trow, .pcard, .note, .kcard) { animation: rise .5s var(--spring) both; animation-delay: calc(min(var(--i, 0), 16) * 26ms + 60ms); }
.stagger .kcol { animation: rise .5s var(--spring) both; }
.stagger .kcol:nth-child(2) { animation-delay: 60ms; }
.stagger .kcol:nth-child(3) { animation-delay: 120ms; }
.stagger .hero-ring { animation: pop-in .7s .1s var(--spring-bounce) both; }

/* Transitions de vue (View Transitions API) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(view) { animation: vt-out .18s ease-in both; }
::view-transition-new(view) { animation: vt-in .38s var(--spring) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
.theme-switch::view-transition-old(root) { animation: none; }
.theme-switch::view-transition-new(root) { animation: theme-reveal .6s var(--spring) both; }
.theme-switch::view-transition-old(view), .theme-switch::view-transition-new(view) { animation: none; }
@keyframes theme-reveal { from { clip-path: circle(0% at 100% 0%); } to { clip-path: circle(150% at 100% 0%); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .main { padding-left: calc(var(--side-w) + 24px + 32px); padding-right: 32px; }
  .masonry { columns: 3 220px; }
}

@media (max-width: 899px) {
  .hide-mobile { display: none !important; }
  .sidebar { display: none; }
  .main { padding: calc(var(--safe-t) + 70px) calc(16px + var(--safe-r)) calc(var(--safe-b) + 116px) calc(16px + var(--safe-l)); }
  .topbar {
    position: fixed; z-index: 40; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    height: calc(var(--safe-t) + 58px); padding: var(--safe-t) calc(8px + var(--safe-r)) 0 calc(14px + var(--safe-l));
    background: linear-gradient(180deg, var(--bg) 10%, transparent);
  }
  .topbar::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: var(--glass);
    -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
    border-bottom: 1px solid var(--line);
    -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent);
    opacity: .95;
  }
  .topbar .brand { padding: 0; font-size: 17px; }
  .topbar-actions { display: flex; gap: 2px; }
  .topbar .icon-btn { width: 44px; height: 44px; border-radius: 13px; }

  .tabbar {
    position: fixed; z-index: 50;
    left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); bottom: max(10px, var(--safe-b));
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    height: 66px; padding: 0 4px;
    background: var(--glass-strong);
    -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--line-2); border-radius: 24px;
    box-shadow: inset 0 1px 0 var(--hi), var(--shadow-3);
  }
  .tabbar a {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 56px; border-radius: 16px;
    font-size: 10.5px; font-weight: 650; letter-spacing: .005em; color: var(--text-3);
    transition: color .2s;
  }
  .tabbar a .ic { width: 23px; height: 23px; transition: transform .35s var(--spring-bounce), color .2s; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active .ic { color: var(--accent-l); transform: translateY(-1px) scale(1.06); }
  .tabbar a.active::before {
    content: ""; position: absolute; top: 5px; width: 34px; height: 30px; border-radius: 11px;
    background: rgba(139, 92, 246, .16); z-index: -1; animation: pop-in .3s var(--spring);
  }
  .tabbar a:active .ic { transform: scale(.88); }
  .tabbar .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
  .tabbar .nav-badge:not(.late) { display: none; }
  .fab {
    left: 50%; right: auto; bottom: calc(max(10px, var(--safe-b)) + 14px);
    width: 60px; height: 60px; border-radius: 21px;
    transform: translateX(-50%);
  }
  .fab:hover { transform: translateX(-50%) translateY(-2px) scale(1.04); }
  .fab:active { transform: translateX(-50%) scale(.92); }
  body.has-overlay .fab { transform: translateX(-50%) scale(.85); }

  .h-xl { font-size: 34px; }
  .sub { font-size: 15.5px; margin-top: 8px; }
  .hero { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 22px; }
  .hero-ring { padding: 8px; border-radius: 24px; }
  .hero-ring .ring { --size: 96px !important; }
  .hero-ring .ring svg { width: 96px; height: 96px; }
  .ring-center strong { font-size: 23px; }
  .ring-center strong span { font-size: 14px; }
  .ring-center small { font-size: 9.5px; }
  .view-head { margin-bottom: 16px; }
  .sec { margin-top: 22px; }
  .list { border-radius: 18px; padding: 4px; }
  .trow { min-height: 56px; }
  .trow-go { display: none; }
  .trow { grid-template-columns: auto 1fr; }
  .toolbar { flex-direction: column; }
  .search-field { flex: none; width: 100%; }
  .toolbar-row { flex-wrap: nowrap; }
  .toolbar-row .select-wrap { flex: 1; min-width: 0; }
  .toolbar-row .select-wrap select { max-width: none; width: 100%; }
  .pgrid { grid-template-columns: 1fr; gap: 12px; }
  .pcard { min-height: 0; }
  .pcard-new { min-height: 120px; flex-direction: row; }
  .phero { padding: 20px 18px 14px; border-radius: 22px; }
  .phero-main { grid-template-columns: auto 1fr; gap: 14px; }
  .phero-ring { display: none; }
  .emoji-tile.xl { width: 56px; height: 56px; font-size: 28px; border-radius: 17px; }
  .title-input { font-size: 25px; }
  .note-actions .icon-btn.sm { width: 30px; height: 30px; }
  .desc-input { margin-top: 12px; }
  .kboard { grid-template-columns: 1fr; gap: 12px; }
  .kcol { min-height: 0; }
  .masonry { columns: 2 150px; column-gap: 10px; }
  .note { margin-bottom: 10px; padding: 14px 13px 6px; border-radius: 16px; }
  .note-content { font-size: 14px; }
  .group-title { margin-top: 26px; }

  /* palette : en haut (le clavier occupe le bas) */
  .palette {
    top: calc(var(--safe-t) + 8px); width: calc(100% - 16px); border-radius: 20px;
    max-height: calc(100dvh - var(--safe-t) - 16px);
  }
  .pal-esc, .pal-keys { display: none; }
  .pal-close { display: inline-grid; }
  #pal-input { font-size: 17px; }
  .pal-list { max-height: 38vh; }
  .pal-foot { justify-content: flex-end; }
  .pal-foot.is-search { display: none; }
  .pal-btns { width: 100%; }
  .pal-btns button { flex: 1; height: 44px; }

  /* tiroir -> feuille du bas */
  .drawer {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: calc(100dvh - var(--safe-t) - 28px);
    border-radius: 26px 26px 0 0; border-bottom: 0;
    padding-bottom: var(--safe-b);
    transform: translateY(105%);
    transition: transform .5s var(--spring);
  }
  .drawer-wrap.open .drawer { transform: none; }
  .sheet-grab { display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line-2); flex: none; }
  .sheet-head { padding: 6px 10px 2px 20px; touch-action: none; }
  .sheet-body { padding: 4px 18px 22px; }
  .d-title { font-size: 21px; }
  .pill { height: 40px; }
  .seg-btn { height: 40px; }

  .toasts { bottom: calc(max(10px, var(--safe-b)) + 84px); }
  .toast { max-width: calc(100vw - 24px); }

  .boot { padding: 0; }
  .boot-main { padding: 80px 16px; }
  .sk-title { width: 70%; }
}

@media (max-width: 420px) {
  .hide-xs { display: none; }
  .trow-meta .chip-ghost { display: none; }
  .pal-item-sub .muted + .muted { display: none; }
  .toolbar-row .seg-btn { min-width: 34px; padding: 0 8px; }
  .composer .swatches { gap: 6px; }
  .h-xl { font-size: 31px; }
  .hero-ring .ring { --size: 84px !important; }
  .hero-ring .ring svg { width: 84px; height: 84px; }
  .ring-center strong { font-size: 20px; }
  .seg-btn { padding: 0 9px; min-width: 38px; }
  .chip-proj { max-width: 150px; }
  .masonry { columns: 2 140px; }
}
@media (max-width: 359px) {
  .masonry { columns: 1; }
}

/* Écran large */
@media (min-width: 1500px) {
  .main { padding-top: 56px; }
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .orb { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Contraste élevé */
@media (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, .2); --text-2: #c8ccd9; --text-3: #a3a8bb; }
  [data-theme="light"] { --line: rgba(15, 23, 42, .25); --text-2: #2f3448; --text-3: #474d63; }
}
