/* ════════════════════════════════════════════════════════════
   base — feuille de style
   Vert forêt + sable, rose vif en accent.
   ════════════════════════════════════════════════════════════ */

@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --forest: #1F3A2E;
  --forest-deep: #142820;
  --forest-2: #2C4A3B;
  --forest-3: #3A5446;
  --sage: #8FB59F;
  --sage-ink: #557A66;
  --sand: #EFE6D6;
  --sand-light: #F7F2E8;
  --sand-2: #E2D7C3;
  --line: #D9CDB8;
  --ink: #142820;
  --muted: #4E5E53;
  --muted-dark: #C9BFA9;
  --pink: #FF3D7F;
  --pink-deep: #E0306C;
  --pink-soft: #FFE3EC;
  --pink-ink: #A3123F;

  --f-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow-1: 0 1px 2px rgba(20, 40, 32, .06), 0 4px 14px rgba(20, 40, 32, .06);
  --shadow-2: 0 2px 6px rgba(20, 40, 32, .08), 0 18px 48px rgba(20, 40, 32, .18);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --sidebar-w: 256px;
  --gutter: clamp(16px, 4vw, 52px);
  --tabbar-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  caret-color: var(--pink);
  overflow-x: hidden;
}
::selection { background: var(--pink); color: var(--ink); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--forest); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
h1, h2, h3 { font-family: var(--f-display); letter-spacing: -0.02em; text-wrap: balance; margin: 0; color: var(--forest); }
p { margin: 0; }
code, kbd { font-family: var(--f-mono); font-size: .9em; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex-shrink: 0; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; border-radius: 6px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--pink); color: var(--ink); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 12px; }

/* Barres de défilement */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 3px solid var(--sand); }
.sidebar::-webkit-scrollbar-thumb { background: var(--forest-3); border-color: var(--forest); }

/* ───────────── Marque ───────────── */
.wordmark { font-family: var(--f-display); font-weight: 800; font-size: 25px; letter-spacing: -0.045em; line-height: 1; color: var(--sand); }
.wordmark--dark { color: var(--forest); }
.logo-mark g { transform-box: view-box; transition: transform .45s var(--ease-spring); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; border-radius: var(--r-sm); }
.brand:hover .logo-l1 { transform: translateY(-5px); }
.brand:hover .logo-l2 { transform: translateY(-2px); }
.logo-mark.is-bouncing .logo-l1 { animation: layer-pop .7s var(--ease-spring); }
.logo-mark.is-bouncing .logo-l2 { animation: layer-pop .7s .06s var(--ease-spring); }
.logo-mark.is-bouncing .logo-l3 { animation: layer-pop .7s .12s var(--ease-spring); }
@keyframes layer-pop { 0% { transform: translateY(0); } 35% { transform: translateY(-14px); } 100% { transform: translateY(0); } }

/* ───────────── Boutons ───────────── */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1.5px solid transparent; border-radius: var(--r-md);
  font-weight: 600; font-size: 15px; line-height: 1.1; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease-out), background-color .18s, border-color .18s, box-shadow .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--pink); color: var(--ink); }
.btn-accent:hover:not(:disabled) { background: #FF5590; box-shadow: 0 6px 18px rgba(255, 61, 127, .32); }
.btn-dark { background: var(--forest); color: var(--sand); }
.btn-dark:hover:not(:disabled) { background: var(--forest-2); }
.btn-outline { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn-outline:hover:not(:disabled) { background: var(--sand-2); }
.btn-ghost { background: transparent; color: var(--forest); }
.btn-ghost:hover:not(:disabled) { background: var(--sand-2); }
.btn-danger { background: transparent; color: var(--pink-ink); border-color: transparent; }
.btn-danger:hover:not(:disabled) { background: var(--pink-soft); }
.btn-lg { min-height: 54px; font-size: 16px; padding: 14px 22px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: var(--r-sm); }

.icon-btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border: none; border-radius: var(--r-sm); background: transparent; color: var(--forest);
  transition: background-color .15s, transform .18s var(--ease-out), color .15s;
}
.icon-btn:hover { background: var(--sand-2); }
.icon-btn:active { transform: scale(.9); }
.icon-btn--dark { background: var(--forest); color: var(--sand); }
.icon-btn--dark:hover { background: var(--forest-2); }
.icon-btn--danger:hover { background: var(--pink-soft); color: var(--pink-ink); }

/* Onde au clic */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: scale(0); opacity: .45; background: currentColor; animation: ripple .6s var(--ease-out) forwards; z-index: -1; }
.btn-accent .ripple { background: #fff; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Étincelles au clic : petits losanges aux couleurs du logo */
.spark { position: fixed; left: 0; top: 0; width: 9px; height: 9px; pointer-events: none; z-index: 200;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: spark var(--d, .55s) var(--ease-out) forwards; }
@keyframes spark {
  0% { transform: translate(var(--x0), var(--y0)) rotate(0) scale(1); opacity: 1; }
  100% { transform: translate(var(--x1), var(--y1)) rotate(var(--rot)) scale(.2); opacity: 0; }
}
.click-ring { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 2px solid var(--pink); pointer-events: none; z-index: 199; animation: click-ring .45s var(--ease-out) forwards; }
@keyframes click-ring { from { transform: translate(var(--x), var(--y)) scale(.3); opacity: .9; } to { transform: translate(var(--x), var(--y)) scale(1.4); opacity: 0; } }

/* ───────────── Champs ───────────── */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field small { font-size: 13px; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--sand-light); color: var(--ink); font-size: 16px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { border-color: #C6B89E; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgba(31, 58, 46, .14); background: #FBF8F2; }
::placeholder { color: #6B7A70; opacity: 1; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231F3A2E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px !important; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }

/* ───────────── Connexion ───────────── */
.auth-body { background: var(--sand); }
.auth { min-height: 100dvh; display: flex; }
.auth-brand { flex: 1 1 50%; position: relative; overflow: hidden; background: var(--forest); color: var(--sand); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-stack { position: absolute; right: -90px; bottom: -70px; opacity: .95; animation: float 9s ease-in-out infinite; }
.auth-stack .logo-mark { width: min(520px, 70vw); height: auto; }
@keyframes float { 50% { transform: translateY(-14px); } }
.auth-claim { position: relative; font-family: var(--f-display); font-weight: 800; font-size: clamp(42px, 5vw, 66px); line-height: .98; letter-spacing: -0.04em; max-width: 9em; }
.auth-claim em { font-style: normal; color: var(--pink); }
.auth-panel { flex: 1 1 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.auth-logo--mobile { display: none; margin-bottom: 36px; }
.auth-logo--mobile .wordmark { color: var(--forest); }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h1 { font-size: 36px; font-weight: 800; letter-spacing: -0.035em; }
.auth-sub { color: var(--muted); margin-top: -10px; }
.auth-error { background: var(--pink-soft); color: var(--pink-ink); border: 1.5px solid var(--pink); border-radius: var(--r-md); padding: 12px 14px; font-weight: 600; font-size: 14px; animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.auth-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.auth-form .btn { width: 100%; margin-top: 4px; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw-toggle { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 46px; height: 44px; border: none; background: transparent; color: var(--muted); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.pw-toggle[aria-pressed="true"] { color: var(--pink-ink); }
@media (max-width: 860px) {
  .auth-brand { display: none; }
  .auth-logo--mobile { display: flex; }
  .auth-panel { justify-content: flex-start; padding-top: 56px; }
}
.message-page { max-width: 560px; margin: 0 auto; padding: 80px 24px; display: flex; flex-direction: column; gap: 18px; }
.message-page h1 { font-size: 40px; font-weight: 800; }
.message-page p { font-size: 17px; color: var(--muted); }

/* ───────────── Structure ───────────── */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; width: var(--sidebar-w); flex-shrink: 0;
  background: var(--forest); color: var(--sand);
  display: flex; flex-direction: column; gap: 28px; padding: 26px 16px 18px; overflow-y: auto;
}
.sidebar .brand { padding: 4px 8px; align-self: flex-start; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px;
  border-radius: var(--r-sm); color: var(--sand); text-decoration: none; font-weight: 500;
  transition: background-color .18s, color .18s, transform .18s var(--ease-out);
}
.nav a:hover { background: var(--forest-2); }
.nav a:active { transform: scale(.97); }
.nav a[aria-current="page"] { background: var(--sand); color: var(--ink); font-weight: 600; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; right: 12px; width: 7px; height: 7px; border-radius: 2px; background: var(--pink); transform: rotate(45deg); }
.side-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-dark); padding: 0 12px 8px; }
.side-projects ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.side-projects a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 12px; border-radius: var(--r-sm); color: var(--sand); text-decoration: none; font-size: 14px; transition: background-color .15s; }
.side-projects a:hover { background: var(--forest-2); }
.side-projects a[aria-current="page"] { background: var(--forest-2); font-weight: 600; }
.side-projects a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { font-size: 13px; color: var(--muted-dark); padding: 0 12px; }
.dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 3px; transform: rotate(45deg); background: var(--pink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.storage { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-md); background: var(--forest-2); }
.storage-label { font-size: 12px; color: var(--muted-dark); }
.storage-value { font-family: var(--f-display); font-weight: 700; font-size: 17px; }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--forest-3); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--pink); transition: width .8s var(--ease-out); }
.logout { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--muted-dark); font-size: 14px; text-align: left; transition: background-color .15s, color .15s; }
.logout:hover { background: var(--forest-2); color: var(--sand); }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 16px var(--gutter); background: rgba(239, 230, 214, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.brand--mobile { display: none; }
.brand--mobile .wordmark { color: var(--forest); font-size: 22px; }
.search-trigger {
  flex: 1 1 auto; max-width: 540px; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px 0 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--sand-light); color: var(--muted); text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .18s var(--ease-out);
}
.search-trigger:hover { border-color: #C6B89E; box-shadow: var(--shadow-1); }
.search-trigger:active { transform: scale(.99); }
.search-trigger-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd { font-size: 12px; padding: 3px 7px; border-radius: 6px; background: var(--sand); border: 1px solid var(--line); color: var(--ink); }
.new-menu { margin-left: auto; position: relative; }

.view { flex: 1; padding: 12px var(--gutter) 72px; outline: none; }
.view > * { animation: view-in .32s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.tabbar { display: none; }

@media (max-width: 860px) {
  :root { --tabbar-h: 76px; }
  .sidebar { display: none; }
  .brand--mobile { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .search-trigger { flex: 0 0 auto; width: 48px; padding: 0; justify-content: center; margin-left: auto; }
  .search-trigger-text, .search-trigger .kbd { display: none; }
  .new-menu { display: none; }
  .view { padding: 8px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    height: 66px; padding: 0 6px; border-radius: 22px; background: var(--forest); box-shadow: var(--shadow-2);
    align-items: center; justify-content: space-around;
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 56px; height: 54px; border-radius: 14px; color: var(--muted-dark); text-decoration: none; font-size: 11px; font-weight: 500; transition: color .15s, background-color .15s; }
  .tabbar a[aria-current="page"] { color: var(--ink); background: var(--sand); }
  .tab-add { width: 58px; height: 58px; margin-top: -28px; border: none; border-radius: 19px; background: var(--pink); color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 5px var(--sand), 0 8px 18px rgba(255, 61, 127, .35); transition: transform .2s var(--ease-spring); }
  .tab-add:active { transform: scale(.88) rotate(90deg); }
  .tab-add .i { width: 26px; height: 26px; }
}

/* ───────────── En-têtes de page ───────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; padding: 18px 0 30px; }
.page-title { font-weight: 800; font-size: clamp(34px, 5.2vw, 62px); line-height: 1; letter-spacing: -0.04em; max-width: 18ch; }
.page-title .hl { background: var(--pink); color: var(--ink); padding: 0 .16em; border-radius: .2em; box-decoration-break: clone; -webkit-box-decoration-break: clone; white-space: nowrap; }
.page-title .soft { color: var(--sage-ink); }
.page-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; color: var(--muted); font-size: 15px; margin-top: 14px; }
.date-chip { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; min-height: 36px; border-radius: 8px; }
.crumb:hover { color: var(--forest); }
.crumb .i { width: 18px; height: 18px; }

.section-title { font-size: 21px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; }
.section-title .count { font-family: var(--f-mono); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 36px; }

.cols { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.col-main { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 30px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }

.panel { background: var(--sand-light); border: 1.5px solid var(--line); border-radius: var(--r-xl); padding: 22px; }
.panel--dark { background: var(--forest); border-color: var(--forest); color: var(--sand); }
.panel--dark h2, .panel--dark h3 { color: var(--sand); }
.panel-label { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-dark); }

/* ───────────── Tâches ───────────── */
.quick-add { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border: 1.5px dashed #BFB197; border-radius: var(--r-lg); background: transparent; transition: border-color .15s, background-color .15s; }
.quick-add:focus-within { border-style: solid; border-color: var(--forest); background: var(--sand-light); }
.quick-add .i { color: var(--muted); }
.quick-add input { flex: 1; min-width: 0; min-height: 44px; border: none; background: transparent; font-size: 16px; outline: none; }
.quick-add .btn { flex-shrink: 0; }

.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 4px;
  border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--sand-light);
  transition: border-color .18s, background-color .18s, transform .25s var(--ease-out), opacity .3s, box-shadow .18s;
}
.task:hover { border-color: #C6B89E; box-shadow: var(--shadow-1); }
.task.is-late { background: var(--pink-soft); border-color: var(--pink); }
.task.is-waiting { border-style: dashed; border-color: #8E9C92; }
.task.is-done { opacity: .62; }
.task.is-leaving { opacity: 0; transform: translateX(24px) scale(.98); }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 8px 4px; border: none; background: none; text-align: left; border-radius: var(--r-sm); }
.task-title { font-weight: 600; font-size: 15.5px; color: var(--ink); overflow-wrap: anywhere;
  background-image: linear-gradient(var(--ink), var(--ink)); background-size: 0 1.5px; background-position: 0 55%; background-repeat: no-repeat; transition: background-size .35s var(--ease-out); }
.task.is-done .task-title { background-size: 100% 1.5px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.task-meta .proj { display: inline-flex; align-items: center; gap: 6px; }
.task-meta .dot { width: 7px; height: 7px; border-radius: 2px; }
.task-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.due { font-family: var(--f-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.is-late { color: var(--pink-ink); font-weight: 500; }

.check { position: relative; width: 44px; height: 44px; flex-shrink: 0; border: none; background: none; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); }
.check-box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--forest); display: flex; align-items: center; justify-content: center; color: var(--sand); background: transparent; transition: background-color .2s, transform .3s var(--ease-spring), border-color .2s; }
.check-box .i { width: 15px; height: 15px; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .3s var(--ease-spring); }
.check:hover .check-box { background: rgba(31, 58, 46, .08); }
.check[aria-pressed="true"] .check-box { background: var(--forest); }
.check[aria-pressed="true"] .check-box .i { opacity: 1; transform: scale(1); }
.check.pop .check-box { animation: check-pop .45s var(--ease-spring); }
@keyframes check-pop { 0% { transform: scale(1); } 30% { transform: scale(.75); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.task.is-late .check-box { border-color: var(--pink-ink); }

.prio { font-family: var(--f-mono); font-size: 11.5px; padding: 4px 8px; border-radius: 7px; white-space: nowrap; line-height: 1.2; }
.prio-0 { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.prio-1 { background: var(--sand-2); color: var(--ink); }
.prio-2 { background: var(--forest); color: var(--sand); }
.prio-3 { background: var(--pink); color: var(--ink); }
.status-tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--sand-2); color: var(--ink); }
.status-doing { background: #D6E6DC; color: var(--forest); }
.status-waiting { background: transparent; border: 1px dashed #8E9C92; color: var(--muted); }
.status-done { background: var(--forest); color: var(--sand); }
.subcount { font-family: var(--f-mono); font-size: 12px; }

.group-label { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 18px 4px 10px; display: flex; align-items: center; gap: 8px; }
.group-label:first-child { margin-top: 0; }
.group-label .n { color: var(--ink); }

.progress-line { height: 8px; border-radius: 99px; background: var(--sand-2); overflow: hidden; }
.progress-line > span { display: block; height: 100%; border-radius: inherit; background: var(--forest); transition: width .7s var(--ease-out); }
.progress-line.accent > span { background: var(--pink); }

/* ───────────── Aujourd'hui ───────────── */
.week { display: flex; flex-direction: column; gap: 16px; }
.week-big { display: flex; align-items: flex-end; gap: 12px; }
.week-big strong { font-family: var(--f-display); font-weight: 800; font-size: 76px; line-height: .8; color: var(--pink); letter-spacing: -0.04em; }
.week-big span { padding-bottom: 4px; font-size: 15px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 70px; }
.bars span { display: block; border-radius: 6px; background: var(--forest-3); min-height: 5px; transform-origin: bottom; animation: bar-in .7s var(--ease-out) backwards; }
.bars span.is-today { background: var(--pink); }
.bars span.is-future { background: var(--forest-2); }
@keyframes bar-in { from { transform: scaleY(0); } }
.bars-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--muted-dark); text-align: center; }

.proj-mini { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-md); text-decoration: none; color: var(--ink); transition: background-color .15s; }
.proj-mini:hover { background: var(--sand-2); }
.proj-mini-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.proj-mini-top span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.proj-mini-top span:first-child b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-mini .progress-line { height: 6px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); background: var(--sand); border: 2px solid var(--line); }
.timeline li.k-done::before { background: var(--forest); border-color: var(--forest); }
.timeline li.k-file::before { background: var(--pink); border-color: var(--pink); }
.timeline li.k-note::before { background: var(--sage); border-color: var(--sage); }
.timeline time { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

/* ───────────── Projets ───────────── */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--sand-2); }
.seg button, .seg a { min-height: 40px; padding: 8px 14px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, box-shadow .15s; }
.seg button:hover, .seg a:hover { background: rgba(247, 242, 232, .6); }
.seg [aria-pressed="true"], .seg [aria-selected="true"], .seg [aria-current="page"] { background: var(--sand-light); box-shadow: var(--shadow-1); font-weight: 600; }
.seg .count { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.filters .input { width: auto; min-width: 0; }
.search-field { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-field .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 44px; }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.project-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; min-height: 200px;
  border-radius: var(--r-xl); background: var(--sand-light); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
  transition: transform .25s var(--ease-out), box-shadow .25s, border-color .2s;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: transparent; }
.project-card:active { transform: translateY(-1px) scale(.99); }
.project-card .swatch { width: 38px; height: 38px; }
.project-card h2 { font-size: 23px; font-weight: 700; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.project-card .sub { font-size: 14px; color: var(--muted); }
.project-card .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.project-card .stats { display: flex; gap: 14px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.project-card.is-archived { background: transparent; border-style: dashed; }
.swatch { display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; border: 1.5px solid var(--forest); color: var(--forest); line-height: 1.2; white-space: nowrap; }
.tag--solid { background: var(--forest); color: var(--sand); }
.tag--pink { background: var(--pink-soft); border-color: var(--pink-soft); color: var(--pink-ink); }
.tag--late { background: var(--pink); border-color: var(--pink); color: var(--ink); }

/* Fiche projet */
.proj-hero { display: flex; flex-wrap: wrap; gap: 24px 32px; align-items: flex-end; justify-content: space-between; padding: 8px 0 26px; }
.proj-hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.proj-hero h1 { font-weight: 800; font-size: clamp(38px, 6vw, 74px); line-height: .95; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.proj-desc { font-size: 16px; color: var(--muted); max-width: 62ch; white-space: pre-line; }
.proj-progress { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: var(--r-xl); background: var(--forest); color: var(--sand); }
.ring { --p: 0; width: 84px; height: 84px; }
.ring circle { fill: none; stroke-width: 10; }
.ring .ring-bg { stroke: var(--forest-3); }
.ring .ring-fg { stroke: var(--pink); stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease-out); }
.proj-progress strong { display: block; font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 1; }
.proj-progress span { font-size: 14px; color: var(--muted-dark); }
.tabs { margin-bottom: 24px; }
.tab-panel { animation: view-in .25s var(--ease-out); }
.overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px; align-items: start; }

/* ───────────── Fichiers ───────────── */
.dropzone {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 24px;
  border: 2.5px dashed var(--forest); border-radius: var(--r-xl); background: var(--sand-light); color: var(--forest); text-align: left; width: 100%;
  transition: background-color .2s, border-color .2s, transform .2s var(--ease-out);
}
.dropzone:hover { background: #FBF8F2; }
.dropzone:active { transform: scale(.99); }
.dropzone.is-over { background: var(--pink-soft); border-color: var(--pink); }
.dropzone-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--pink); color: var(--ink); display: flex; align-items: center; justify-content: center; transition: transform .3s var(--ease-spring); }
.dropzone:hover .dropzone-icon { transform: translateY(-4px) rotate(-6deg); }
.dropzone-text strong { display: block; font-family: var(--f-display); font-weight: 700; font-size: 19px; }
.dropzone-text span { font-size: 14px; color: var(--muted); }
.dropzone--compact { padding: 16px; flex-direction: column; text-align: center; gap: 8px; }
.dropzone--compact .dropzone-icon { width: 42px; height: 42px; border-radius: 12px; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 16px; }
.file-card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--sand-light); border: 1.5px solid var(--line); overflow: hidden; transition: transform .25s var(--ease-out), box-shadow .25s; }
.file-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.file-thumb { position: relative; height: 132px; display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px; border: none; width: 100%; text-align: left; overflow: hidden; }
.file-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out); }
.file-card:hover .file-thumb img { transform: scale(1.04); }
.file-thumb .ext { position: relative; font-family: var(--f-display); font-weight: 800; font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.file-thumb .size { position: relative; font-family: var(--f-mono); font-size: 12px; }
.file-thumb.has-img .ext, .file-thumb.has-img .size { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.file-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.file-name { margin: 0; font-family: var(--f-body); font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions { display: flex; gap: 6px; margin-top: 8px; }
.file-actions .btn { flex: 1; }

.k-pdf { background: var(--pink); color: var(--ink); }
.k-img { background: var(--forest); color: var(--sand); }
.k-doc { background: var(--sand-2); color: var(--ink); }
.k-sheet { background: var(--sage); color: var(--ink); }
.k-design { background: #D6E6DC; color: var(--forest); }
.k-archive { background: var(--forest-deep); color: var(--pink); }
.k-other { background: var(--sand-2); color: var(--muted); }

.file-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 7px; border-radius: var(--r-md); background: var(--sand); }
.file-row .badge { width: 44px; height: 44px; flex-shrink: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; overflow: hidden; }
.file-row .badge img { width: 100%; height: 100%; object-fit: cover; }
.file-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }

.upload-queue { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
.upload-item { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.upload-item .progress-line { flex: 1; height: 6px; }
.upload-item .name { flex: 0 1 40%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drop-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(20, 40, 32, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade-in .18s; pointer-events: none; }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--sand); text-align: center; padding: 40px; border: 3px dashed var(--pink); border-radius: 32px; }
.drop-stack .logo-l1 { animation: hover-layer 1.2s ease-in-out infinite; }
.drop-stack .logo-l2 { animation: hover-layer 1.2s .1s ease-in-out infinite; }
@keyframes hover-layer { 50% { transform: translateY(-10px); } }
.drop-title { font-family: var(--f-display); font-weight: 800; font-size: 34px; letter-spacing: -0.03em; }
.drop-target { color: var(--muted-dark); }
@keyframes fade-in { from { opacity: 0; } }

/* ───────────── Notes ───────────── */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.note-card { display: flex; flex-direction: column; gap: 10px; min-height: 170px; padding: 20px; border-radius: var(--r-lg); background: var(--sand-light); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; transition: transform .25s var(--ease-out), box-shadow .25s; }
.note-card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-2); }
.note-card:nth-child(4n+2):hover { transform: translateY(-3px) rotate(.4deg); }
.note-card h3 { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.2; overflow-wrap: anywhere; }
.note-card p { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.note-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.note-card.is-pinned { background: var(--forest); border-color: var(--forest); }
.note-card.is-pinned h3 { color: var(--sand); }
.note-card.is-pinned p, .note-card.is-pinned .foot { color: var(--muted-dark); }
.note-card.is-pinned .tag { border-color: var(--muted-dark); color: var(--sand); }

.note-editor { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.note-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.note-top-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.save-state { font-family: var(--f-mono); font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-width: 120px; justify-content: flex-end; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--sage); }
.save-state.is-saving::before { background: var(--pink); animation: blink .8s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.note-title { width: 100%; border: none; background: transparent; font-family: var(--f-display); font-weight: 800; font-size: clamp(30px, 4.5vw, 50px); line-height: 1.05; letter-spacing: -0.035em; color: var(--forest); padding: 4px 0; outline: none; }
.note-title::placeholder { color: #A39983; }
.toolbar { position: sticky; top: 80px; z-index: 10; display: flex; flex-wrap: wrap; gap: 2px; padding: 5px; border-radius: var(--r-md); background: var(--forest); align-self: flex-start; box-shadow: var(--shadow-1); }
.toolbar button { width: 40px; height: 40px; border: none; border-radius: 9px; background: transparent; color: var(--sand); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; transition: background-color .15s, transform .15s var(--ease-out); }
.toolbar button:hover { background: var(--forest-2); }
.toolbar button:active { transform: scale(.88); }
.toolbar button.is-on { background: var(--pink); color: var(--ink); }
.toolbar .sep { width: 1px; margin: 6px 4px; background: var(--forest-3); }
.toolbar .i { width: 18px; height: 18px; }

.prose { min-height: 50vh; font-size: 17px; line-height: 1.65; color: var(--ink); outline: none; padding: 6px 0 40px; overflow-wrap: anywhere; }
.prose:empty::before { content: attr(data-placeholder); color: #8C826E; pointer-events: none; }
.prose > * + * { margin-top: .7em; }
.prose p, .prose div { margin: 0; }
.prose h2 { font-size: 28px; font-weight: 700; margin-top: 1.2em; color: var(--forest); }
.prose h3 { font-size: 21px; font-weight: 700; margin-top: 1em; color: var(--forest); }
.prose strong, .prose b { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0; }
.prose li + li { margin-top: .25em; }
.prose ul:not(.checklist) li::marker { color: var(--pink); }
.prose blockquote { margin: 0; padding: 4px 0 4px 18px; font-family: var(--f-display); font-size: 21px; font-weight: 500; color: var(--forest); position: relative; }
.prose blockquote::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--pink); }
.prose a { color: var(--forest); font-weight: 600; text-decoration-color: var(--pink); }
.prose code { background: var(--sand-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--forest-deep); color: var(--sand); padding: 16px; border-radius: var(--r-md); overflow-x: auto; font-family: var(--f-mono); font-size: 14px; }
.prose hr { border: none; height: 2px; background: var(--line); margin: 1.5em 0; }
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 34px; min-height: 28px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 3px; width: 21px; height: 21px; border-radius: 7px; border: 2px solid var(--forest); box-sizing: border-box; cursor: pointer; transition: background-color .15s, transform .25s var(--ease-spring); }
.checklist li[data-checked="true"]::before { background: var(--forest) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5L20 7' fill='none' stroke='%23EFE6D6' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.checklist li[data-checked="true"] { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--pink); text-decoration-thickness: 2px; }
.checklist li.pop::before { animation: check-pop .45s var(--ease-spring); }
.note-preview.prose { min-height: 0; font-size: 15px; padding: 0; }

/* ───────────── Tiroir (édition tâche / projet / fichier) ───────────── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(20, 40, 32, .45); animation: fade-in .2s; }
.drawer {
  position: fixed; z-index: 61; top: 10px; right: 10px; bottom: 10px; width: min(520px, calc(100vw - 20px));
  display: flex; flex-direction: column; background: var(--sand); border-radius: var(--r-xl); box-shadow: var(--shadow-2);
  animation: drawer-in .35s var(--ease-out); overflow: hidden;
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
.drawer.is-closing { animation: drawer-out .2s ease-in forwards; }
.scrim.is-closing { animation: fade-out .2s forwards; }
@keyframes drawer-out { to { transform: translateX(40px); opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 24px; }
.drawer-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 24px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px 18px; border-top: 1.5px solid var(--line); background: var(--sand); }
.drawer-foot .spacer { flex: 1; }
.title-input { border: none !important; background: transparent !important; box-shadow: none !important; padding: 4px 0 !important; font-family: var(--f-display); font-weight: 700; font-size: 26px !important; letter-spacing: -0.02em; color: var(--forest); min-height: 0 !important; resize: none; }
@media (max-width: 640px) {
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation-name: sheet-in; padding-bottom: env(safe-area-inset-bottom); }
  .drawer.is-closing { animation-name: sheet-out; }
  @keyframes sheet-in { from { transform: translateY(60px); opacity: 0; } }
  @keyframes sheet-out { to { transform: translateY(60px); opacity: 0; } }
}

.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick label { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.pick span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 13px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--sand-light); font-size: 14px; font-weight: 500; transition: background-color .15s, border-color .15s, transform .2s var(--ease-spring); }
.pick input:checked + span { background: var(--forest); border-color: var(--forest); color: var(--sand); }
.pick input:checked + span.p3 { background: var(--pink); border-color: var(--pink); color: var(--ink); }
.pick input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.pick input:active + span { transform: scale(.94); }
.colors span { width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 3px solid transparent; justify-content: center; }
.colors input:checked + span { border-color: var(--ink); background: inherit; transform: scale(1.06); }

.subtasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.subtask { display: flex; align-items: center; gap: 4px; padding-right: 4px; border-radius: var(--r-sm); background: var(--sand-light); }
.subtask .check { width: 40px; height: 40px; }
.subtask .check-box { width: 20px; height: 20px; border-radius: 6px; }
.subtask .check-box .i { width: 12px; height: 12px; }
.subtask span.t { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.subtask.is-done span.t { text-decoration: line-through; color: var(--muted); }
.subtask .icon-btn { width: 36px; height: 36px; opacity: .55; }
.subtask .icon-btn:hover { opacity: 1; }
.sub-add { display: flex; gap: 8px; margin-top: 6px; }
.sub-add input { flex: 1; min-height: 42px !important; }

/* ───────────── Aperçu de fichier ───────────── */
.viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: rgba(20, 40, 32, .94); animation: fade-in .2s; }
.viewer-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--sand); }
.viewer-head .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-head .icon-btn { color: var(--sand); }
.viewer-head .icon-btn:hover { background: var(--forest-2); }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px 16px; }
.viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; animation: zoom-in .35s var(--ease-out); }
.viewer-body iframe { width: 100%; height: 100%; max-width: 1100px; border: none; border-radius: 12px; background: #fff; }
@keyframes zoom-in { from { transform: scale(.94); opacity: 0; } }
.viewer-none { text-align: center; color: var(--sand); display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ───────────── Palette de recherche ───────────── */
.palette-wrap { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; background: rgba(20, 40, 32, .5); animation: fade-in .15s; }
.palette { width: min(680px, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--sand-light); border-radius: var(--r-xl); box-shadow: var(--shadow-2); overflow: hidden; animation: palette-in .25s var(--ease-out); }
@keyframes palette-in { from { transform: translateY(-10px) scale(.98); opacity: 0; } }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 20px; border-bottom: 1.5px solid var(--line); }
.palette-input .i { color: var(--pink-ink); width: 22px; height: 22px; }
.palette-input input { flex: 1; min-width: 0; min-height: 58px; border: none; background: transparent; font-size: 19px; outline: none; }
.palette-results { overflow-y: auto; padding: 8px; }
.palette-group { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 8px 12px; border: none; border-radius: var(--r-md); background: transparent; text-align: left; color: var(--ink); text-decoration: none; }
.palette-item[aria-selected="true"] { background: var(--forest); color: var(--sand); }
.palette-item[aria-selected="true"] .sub { color: var(--muted-dark); }
.palette-item .ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--sand-2); color: var(--forest); font-family: var(--f-mono); font-size: 10px; }
.palette-item[aria-selected="true"] .ic { background: var(--forest-2); color: var(--sand); }
.palette-item .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item mark { background: var(--pink); color: var(--ink); border-radius: 3px; padding: 0 1px; }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1.5px solid var(--line); font-size: 12px; color: var(--muted); }
.palette-foot kbd { font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--sand); border: 1px solid var(--line); color: var(--ink); }
@media (max-width: 640px) { .palette-wrap { padding: 12px 10px; } .palette { max-height: 86dvh; } .palette-foot { display: none; } }

/* ───────────── Menu « Nouveau » ───────────── */
.menu { position: fixed; z-index: 75; min-width: 230px; padding: 6px; border-radius: var(--r-lg); background: var(--forest); box-shadow: var(--shadow-2); animation: menu-in .2s var(--ease-out); transform-origin: top right; }
@keyframes menu-in { from { transform: scale(.94); opacity: 0; } }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px 14px; border: none; border-radius: var(--r-md); background: transparent; color: var(--sand); font-size: 15px; font-weight: 500; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--forest-2); outline: none; }
.menu kbd { margin-left: auto; font-size: 11px; color: var(--muted-dark); }

/* ───────────── Toasts & confirmations ───────────── */
.toasts { position: fixed; z-index: 95; left: 50%; bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; min-height: 48px; border-radius: var(--r-md); background: var(--forest-deep); color: var(--sand); box-shadow: var(--shadow-2); font-size: 14.5px; font-weight: 500; animation: toast-in .35s var(--ease-spring); }
.toast.is-error { background: var(--pink); color: var(--ink); }
.toast.is-out { animation: toast-out .2s forwards; }
.toast button { border: none; background: var(--forest-2); color: var(--pink); font-weight: 700; border-radius: 9px; min-height: 34px; padding: 6px 12px; }
@keyframes toast-in { from { transform: translateY(16px) scale(.96); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

.confirm { position: fixed; z-index: 85; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 40, 32, .5); animation: fade-in .15s; }
.confirm-box { width: min(420px, 100%); padding: 26px; border-radius: var(--r-xl); background: var(--sand); box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 14px; animation: palette-in .25s var(--ease-out); }
.confirm-box h2 { font-size: 22px; font-weight: 800; }
.confirm-box p { color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ───────────── États vides & chargement ───────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 44px 20px; border-radius: var(--r-xl); border: 2px dashed var(--line); color: var(--muted); }
.empty .logo-mark { opacity: .9; }
.empty strong { font-family: var(--f-display); font-size: 21px; color: var(--forest); font-weight: 700; }
.empty p { max-width: 42ch; }
.empty--small { padding: 22px 16px; gap: 6px; }
.empty--small strong { font-size: 16px; }
.empty--dark { border-color: var(--forest-3); color: var(--muted-dark); }

.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--sand-2) 0, #EAE0CE 40%, var(--sand-2) 80%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-list { display: flex; flex-direction: column; gap: 10px; }
.loading-list .skeleton { height: 64px; }

.welcome { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.welcome-step { flex: 1 1 220px; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r-lg); background: var(--sand-light); border: 1.5px solid var(--line); text-align: left; color: var(--ink); transition: transform .2s var(--ease-out), box-shadow .2s; }
.welcome-step:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.welcome-step strong { font-family: var(--f-display); font-size: 18px; color: var(--forest); }
.welcome-step span { font-size: 14px; color: var(--muted); }

/* Page « Plus » (mobile) */
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.more-grid a, .more-grid button { display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 110px; border-radius: var(--r-lg); background: var(--sand-light); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; text-align: left; }
.more-grid .i { width: 26px; height: 26px; color: var(--forest); }

/* Récap hebdo */
.recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.recap div { padding: 16px; border-radius: var(--r-lg); background: var(--sand-light); border: 1.5px solid var(--line); }
.recap strong { display: block; font-family: var(--f-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--forest); }
.recap div:first-child { background: var(--forest); border-color: var(--forest); color: var(--sand); }
.recap div:first-child strong { color: var(--pink); }
.recap span { font-size: 14px; }
.week-compare { font-size: 14px; color: var(--muted); margin-top: 10px; }
.day-head { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; }

/* ───────────── Mouvement réduit ───────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spark, .click-ring, .ripple { display: none !important; }
}

/* ───────────── Ajustements ───────────── */
.view.is-soft > * { animation: none; }
.progress-line + .quick-add { margin-top: 16px; }
.quick-add + .group-wrap { margin-top: 12px; }
.panel .quick-add { margin-bottom: 0; }
.panel .task { background: var(--sand); }
.panel .task.is-late { background: var(--pink-soft); }
.panel--dark .note-preview { color: var(--sand); font-size: 15px; line-height: 1.6; white-space: pre-line; }
.btn-outline.on-dark { border-color: var(--sand); color: var(--sand); }
.btn-outline.on-dark:hover { background: var(--forest-2); }
.empty--dark strong { color: var(--sand); }
.icon-btn.is-on { background: var(--pink); color: var(--ink); }
.filters select.input { min-height: 48px; }
.page-head > div { min-width: 0; }
@media (max-width: 860px) {
  .task-side .prio { display: none; }
  .task.is-late .task-side .prio, .task-side .prio-3 { display: inline-block; }
  .filters .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .filters .seg a { flex-shrink: 0; }
  .filters select.input { flex: 1 1 140px; }
  .proj-progress { width: 100%; }
  .toolbar { top: 70px; }
}
.task-title { align-self: flex-start; }
.task-list { container-type: inline-size; }
@container (max-width: 460px) {
  .task { flex-wrap: wrap; row-gap: 0; }
  .task-body { flex: 1 1 0; }
  .task-side { width: 100%; padding: 0 0 8px 50px; }
  .task-side:empty { display: none; }
}
.note-top select.input { width: auto; min-width: 170px; max-width: 240px; min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-size: 15px; }
.note-top-right { justify-content: flex-end; }
.field .title-input { resize: none; overflow: hidden; }
@media (max-width: 860px) {
  .seg.tabs { display: flex; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .seg.tabs::-webkit-scrollbar { display: none; }
  .seg.tabs a { flex-shrink: 0; }
  .proj-progress { padding: 14px 18px; }
  .ring { width: 64px; height: 64px; }
  .proj-progress strong { font-size: 32px; }
}
@media (max-width: 860px) {
  .menu kbd { display: none; }
  .note-top { flex-direction: column; align-items: stretch; }
  .note-top-right { flex-wrap: nowrap; justify-content: flex-start; }
  .note-top select.input { flex: 1; min-width: 0; max-width: none; }
  .save-state { min-width: 0; order: 3; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar button { flex-shrink: 0; }
}
.sidebar .dot { box-shadow: 0 0 0 1.5px rgba(239, 230, 214, .6); }

/* ───────────── Fichiers 1.1 : vignettes, icônes, noms ───────────── */
.file-thumb { display: block; height: 150px; padding: 0; }
.file-thumb .kind-ic { position: absolute; left: 14px; top: 14px; width: 34px; height: 34px; opacity: .9; }
.file-thumb .ext { position: absolute; left: 14px; bottom: 12px; }
.file-thumb .size { position: absolute; right: 14px; bottom: 14px; }
.file-thumb img { object-position: center; }
.file-thumb.is-pdf img { object-position: top center; }
.file-thumb.has-img { background: var(--sand-2); }
.file-thumb.has-img .kind-ic { display: none; }
.file-thumb.has-img .ext, .file-thumb.has-img .size { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .02em; padding: 4px 8px; border-radius: 7px; background: rgba(20, 40, 32, .82); color: var(--sand); text-shadow: none; line-height: 1.2; }
.file-thumb.has-img.is-pdf .ext { background: var(--pink); color: var(--ink); }
.file-thumb.is-pdf.has-img::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46px; background: linear-gradient(transparent, rgba(20, 40, 32, .18)); pointer-events: none; }
.file-name { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.35; }
.file-info .file-name { min-height: 2.7em; }
.badge { position: relative; }
.badge .kind-ic { width: 22px; height: 22px; }
.badge img { position: absolute; inset: 0; }
.badge.has-img .kind-ic { display: none; }
.badge.has-img { background: var(--sand-2); }
.file-row .grow .file-name { font-size: 14px; }
.k-video { background: var(--forest-deep); color: var(--sand); }
.k-audio { background: #D6E6DC; color: var(--forest); }
.k-slides { background: #F6C9A8; color: var(--ink); }
.k-code { background: var(--forest-2); color: #B7D0C1; }
.palette-item .ic img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.palette-item .ic { overflow: hidden; }
.palette-item .ic .i { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .file-thumb { height: 118px; }
  .file-thumb .kind-ic { width: 28px; height: 28px; left: 12px; top: 12px; }
  .file-thumb .ext { font-size: 24px; left: 12px; bottom: 10px; }
  .file-thumb .size { display: none; }
  .file-thumb.has-img .ext { font-size: 10.5px; }
  .file-info { padding: 10px 10px 12px; }
  .file-info .file-name { font-size: 13.5px; }
  .file-sub { font-size: 12px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
  .file-actions .btn-outline { display: none; }
  .file-actions { justify-content: flex-end; }
}
@media (max-width: 640px) { .file-info .file-name { -webkit-line-clamp: 3; } }
.toast .up-pct { font-family: var(--f-mono); font-size: 12px; color: var(--muted-dark); min-width: 38px; text-align: right; }

/* Suppression directe d'un fichier */
.file-card, .file-row { transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); }
.file-card.is-removing, .file-row.is-removing { opacity: 0; transform: scale(.94); pointer-events: none; }
.file-actions { gap: 4px; }
.file-actions .icon-btn--danger { color: var(--muted); }
.file-actions .icon-btn--danger:hover { color: var(--pink-ink); }
button.badge { border: none; padding: 0; cursor: pointer; transition: transform .2s var(--ease-out); }
button.badge:hover { transform: scale(1.06); }
.file-row button.grow { border: none; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.file-row .icon-btn--danger { color: var(--muted); }
@media (max-width: 640px) {
  .file-actions { justify-content: space-between; }
  .file-actions .icon-btn { width: 40px; height: 40px; }
}

/* ───────────── Calendrier ───────────── */
.cal-head .head-actions { align-items: center; }
.cal { background: var(--sand-light); border: 1.5px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--forest); color: var(--muted-dark); font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
.cal-week span { padding: 11px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(118px, auto); }
.cal-day { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .15s; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:nth-last-child(-n+7) { border-bottom: none; }
.cal-day:hover { background: #FBF8F2; }
.cal-day.is-weekend { background: rgba(226, 215, 195, .35); }
.cal-day.is-out { background: rgba(226, 215, 195, .55); }
.cal-day.is-out .cal-date { color: #8C826E; }
.cal-day.is-selected { background: #fff; box-shadow: inset 0 0 0 2px var(--forest); }
.cal-day.is-over { background: var(--pink-soft); box-shadow: inset 0 0 0 2px var(--pink); }
.cal-date { align-self: flex-start; min-width: 34px; height: 34px; padding: 0 8px; border: none; border-radius: 10px; background: transparent; font-family: var(--f-display); font-weight: 700; font-size: 15px; color: var(--ink); transition: background-color .15s, transform .2s var(--ease-spring); }
.cal-date:hover { background: var(--sand-2); }
.cal-date:active { transform: scale(.9); }
.cal-day.is-today .cal-date { background: var(--pink); color: var(--ink); }
.cal-day.is-selected:not(.is-today) .cal-date { background: var(--forest); color: var(--sand); }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 26px; padding: 3px 7px; border: none; border-radius: 7px; background: var(--sand-2); color: var(--ink); font-size: 12.5px; font-weight: 500; text-align: left; cursor: grab; transition: transform .15s var(--ease-out), box-shadow .15s, opacity .2s; }
.cal-chip > span:not(.dot):not(.prio) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip .dot { width: 7px; height: 7px; border-radius: 2px; }
.cal-chip:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); }
.cal-chip:active { cursor: grabbing; }
.cal-chip.is-late { background: var(--pink-soft); color: var(--pink-ink); }
.cal-chip.is-urgent { box-shadow: inset 0 0 0 1.5px var(--pink); }
.cal-chip.is-done { opacity: .55; text-decoration: line-through; }
.cal-chip.is-dragging { opacity: .35; }
.cal-deadline { background: var(--pink); color: var(--ink); font-weight: 600; cursor: default; }
.cal-deadline .i { width: 13px; height: 13px; }
.cal-more { align-self: flex-start; border: none; background: none; padding: 2px 7px; border-radius: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.cal-more:hover { background: var(--sand-2); color: var(--ink); }
.cal-dots { display: none; }
.view.is-dragging-task .cal-day { cursor: copy; }
.cal-hint { font-size: 13px; color: var(--muted); margin-top: 12px; }
.cal-panel .quick-add { margin: 4px 0 12px; }
.cal-deadline-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--r-md); background: var(--pink); color: var(--ink); text-decoration: none; font-size: 14px; }
.cal-deadline-row .i { width: 18px; height: 18px; }
.cal-undated { transition: background-color .15s, box-shadow .15s; }
.cal-undated.is-over { background: var(--pink-soft); box-shadow: inset 0 0 0 2px var(--pink); }
.cal-undated .cal-hint { margin: -4px 0 10px; }
.cal-undated-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cal-chip--wide { min-height: 40px; padding: 8px 12px; font-size: 14px; background: var(--sand); border: 1.5px solid var(--line); border-radius: var(--r-md); }
.cal-chip--wide .prio { font-size: 10.5px; padding: 3px 6px; }
.cal-empty { padding: 0; }

@media (max-width: 860px) {
  .cal-head .btn-accent { display: none; }
  .cal-grid { grid-auto-rows: minmax(58px, auto); }
  .cal-week span { padding: 8px 0; text-align: center; font-size: 10.5px; }
  .cal-day { align-items: center; padding: 4px 2px 6px; gap: 3px; }
  .cal-date { min-width: 34px; height: 34px; padding: 0; font-size: 14px; }
  .cal-items { display: none; }
  .cal-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 100%; }
  .cal-dot { width: 6px; height: 6px; border-radius: 2px; transform: rotate(45deg); }
  .cal-dot.is-late { background: var(--pink) !important; }
  .cal-dot.is-done { opacity: .4; }
  .cal-dot.is-deadline { background: var(--pink); width: 7px; height: 7px; }
  .cal-hint { display: none; }
}

.col-main.cal-main { flex: 3 1 640px; }
.cal-chip { font-size: 12px; padding: 3px 6px; gap: 5px; }
.cal-chip.cal-chip--wide { font-size: 14px; padding: 8px 12px; gap: 8px; }

/* ───────────── Priorités : une couleur par importance ───────────── */
:root { --p0: #CFC3AC; --p1: #8FB59F; --p2: #F0A23B; --p3: #FF3D7F; --p2-soft: #FCEFD9; --p3-soft: #FFE8EF; }
.prio { font-weight: 500; }
.prio-0 { background: var(--p0); color: var(--ink); border: none; }
.prio-1 { background: var(--p1); color: var(--ink); }
.prio-2 { background: var(--p2); color: var(--ink); }
.prio-3 { background: var(--p3); color: var(--ink); }
.task.tp-0 .check-box { border-color: #9E9278; }
.task.tp-1 .check-box { border-color: var(--sage-ink); }
.task.tp-2 .check-box { border-color: #C77A12; border-width: 2.5px; }
.task.tp-3 .check-box { border-color: var(--pink-deep); border-width: 2.5px; }
.task.tp-2:not(.is-late):not(.is-done) { background: var(--p2-soft); border-color: #EFCF9A; }
.task.tp-3:not(.is-late):not(.is-done) { background: var(--p3-soft); border-color: #FFB3CB; }
.panel .task.tp-2:not(.is-late):not(.is-done) { background: var(--p2-soft); }
.panel .task.tp-3:not(.is-late):not(.is-done) { background: var(--p3-soft); }
.task.tp-1 .check[aria-pressed="true"] .check-box, .task.tp-0 .check[aria-pressed="true"] .check-box { background: var(--forest); border-color: var(--forest); }
.pick input:checked + span.p0 { background: var(--p0); border-color: var(--p0); color: var(--ink); }
.pick input:checked + span.p1 { background: var(--p1); border-color: var(--p1); color: var(--ink); }
.pick input:checked + span.p2 { background: var(--p2); border-color: var(--p2); color: var(--ink); }
.pick span.p0::before, .pick span.p1::before, .pick span.p2::before, .pick span.p3::before { content: ""; width: 9px; height: 9px; border-radius: 3px; transform: rotate(45deg); }
.pick span.p0::before { background: var(--p0); } .pick span.p1::before { background: var(--p1); } .pick span.p2::before { background: var(--p2); } .pick span.p3::before { background: var(--p3); }
.pick input:checked + span.p0::before, .pick input:checked + span.p1::before, .pick input:checked + span.p2::before, .pick input:checked + span.p3::before { background: var(--ink); }
.cal-chip.cp-0 { background: #EAE2D3; }
.cal-chip.cp-1 { background: #DCE9E1; }
.cal-chip.cp-2 { background: var(--p2-soft); box-shadow: inset 3px 0 0 var(--p2); }
.cal-chip.cp-3 { background: var(--p3-soft); box-shadow: inset 3px 0 0 var(--p3); font-weight: 600; }
.cal-chip.is-late { background: var(--pink-soft); color: var(--pink-ink); }
@media (max-width: 860px) {
  .task-side .prio, .task.is-late .task-side .prio, .task-side .prio-3 { display: inline-block; font-size: 10.5px; padding: 3px 6px; }
}

/* ───────────── Notes : couleurs ───────────── */
.nc-sable { --nc-bg: #F7F2E8; --nc-line: #D9CDB8; --nc-ink: var(--ink); --nc-muted: var(--muted); }
.nc-rose { --nc-bg: #FFE3EC; --nc-line: #FFB8CE; --nc-ink: var(--ink); --nc-muted: #6E4352; }
.nc-sauge { --nc-bg: #D6E6DC; --nc-line: #A9C8B5; --nc-ink: var(--ink); --nc-muted: #3E5A49; }
.nc-foret { --nc-bg: #1F3A2E; --nc-line: #1F3A2E; --nc-ink: #EFE6D6; --nc-muted: #C9BFA9; }
.nc-ciel { --nc-bg: #DCE6F2; --nc-line: #B3C7DE; --nc-ink: var(--ink); --nc-muted: #3F536B; }
.nc-soleil { --nc-bg: #F8E7B5; --nc-line: #E9CE7F; --nc-ink: var(--ink); --nc-muted: #5E4E22; }
.note-card { position: relative; background: var(--nc-bg); border-color: var(--nc-line); }
.note-card h3 { color: var(--nc-ink); padding-right: 22px; }
.note-card p, .note-card .foot { color: var(--nc-muted); }
.note-card .tag { border-color: var(--nc-ink); color: var(--nc-ink); }
.note-pin { position: absolute; top: 16px; right: 16px; color: var(--nc-ink); }
.note-pin .i { width: 18px; height: 18px; }
.swatch-dot { display: inline-block; width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; background: var(--nc-bg); border: 2px solid var(--nc-line); padding: 0; transition: transform .2s var(--ease-spring), box-shadow .15s; }
.swatch-dot:hover { transform: scale(1.1); }
.swatch-dot[aria-checked="true"], .swatch-dot[aria-current="page"] { box-shadow: 0 0 0 2px var(--sand), 0 0 0 4px var(--ink); }
.nc-sable.swatch-dot { border-color: #C6B89E; }
.color-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-filter a.swatch-dot { position: relative; }
.color-filter a.swatch-dot::after { content: ""; position: absolute; inset: -7px; }
.cf-all { min-height: 36px; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: none; border: 1.5px solid var(--line); }
.cf-all[aria-current="page"] { background: var(--forest); border-color: var(--forest); color: var(--sand); }
.note-colors { display: flex; gap: 6px; align-items: center; padding: 0 4px; }
.note-colors .swatch-dot { width: 26px; height: 26px; border-radius: 8px; position: relative; }
.note-colors .swatch-dot::after { content: ""; position: absolute; inset: -9px; }
.note-paper { background: var(--nc-bg); border: 1.5px solid var(--nc-line); border-radius: var(--r-xl); padding: clamp(18px, 3vw, 34px); display: flex; flex-direction: column; gap: 16px; transition: background-color .35s var(--ease-out), border-color .35s; }
.note-editor .note-paper .note-title { color: var(--nc-ink); }
.note-editor .note-paper .prose { color: var(--nc-ink); min-height: 40vh; }
.nc-foret .note-paper .note-title::placeholder, .nc-foret .note-paper .prose:empty::before { color: #8EA597; }
.nc-foret .note-paper .prose h2, .nc-foret .note-paper .prose h3, .nc-foret .note-paper .prose blockquote, .nc-foret .note-paper .prose a { color: var(--sand); }
.nc-foret .note-paper .checklist li::before { border-color: var(--sand); }
.nc-foret .note-paper .checklist li[data-checked="true"]::before { background-color: var(--pink); border-color: var(--pink); }
.nc-foret .note-paper .prose code { background: var(--forest-2); }
.nc-foret .note-paper .toolbar { background: var(--forest-deep); }
.note-paper .toolbar { top: 76px; }
@media (max-width: 860px) {
  .note-colors { order: 4; width: 100%; padding: 4px 0 0; gap: 10px; }
  .note-colors .swatch-dot { width: 32px; height: 32px; }
  .note-top-right { flex-wrap: wrap; }
}
.nc-foret .note-paper .checklist li[data-checked="true"] { color: #9DB3A6; }
.nc-foret .note-paper .prose ul:not(.checklist) li::marker { color: var(--pink); }

.cal-chip.cp-2 { box-shadow: none; background: #F9E3BE; }
.cal-chip.cp-3 { box-shadow: none; background: #FFD3E1; }
.cal-chip.cp-2:hover, .cal-chip.cp-3:hover { box-shadow: var(--shadow-1); }

/* ───────────── Notes en liste ───────────── */
.view-toggle button .i { width: 17px; height: 17px; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1.5px solid var(--line); border-radius: var(--r-xl); background: var(--sand-light); overflow: hidden; }
.note-list li + li { border-top: 1px solid var(--line); }
.note-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 18px; color: var(--ink); text-decoration: none; transition: background-color .15s; }
.note-row:hover { background: #FBF8F2; }
.note-row:active { background: var(--sand-2); }
.note-row-swatch { width: 14px; height: 14px; flex-shrink: 0; border-radius: 4px; transform: rotate(45deg); background: var(--nc-bg); border: 2px solid var(--nc-line); }
.note-row.nc-sable .note-row-swatch { border-color: #B3A68D; }
.note-row.nc-foret .note-row-swatch { border-color: var(--forest); }
.note-row-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 14px; }
.note-row-title { flex: 0 1 auto; max-width: 40%; font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row-excerpt { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-row-meta { flex-shrink: 0; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.note-row-meta .tag { font-size: 12px; padding: 3px 9px; }
.note-row-date { font-family: var(--f-mono); font-size: 12px; min-width: 70px; text-align: right; }
.note-row-pin { color: var(--forest); display: flex; }
.note-row-pin .i { width: 16px; height: 16px; }
.note-row-free { font-size: 12.5px; }
.tab-panel .section-head .view-toggle { margin-right: auto; }
@media (max-width: 760px) {
  .note-row { align-items: flex-start; padding: 14px 16px; gap: 12px; }
  .note-row-swatch { margin-top: 5px; }
  .note-row-main { flex-direction: column; gap: 3px; }
  .note-row-title { max-width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .note-row-meta { flex-direction: column; align-items: flex-end; gap: 6px; }
  .note-row-meta .tag, .note-row-free { display: none; }
  .note-row-date { min-width: 0; }
  .view-toggle button span { display: none; }
  .view-toggle button { padding: 8px 12px; }
}
@media (max-width: 760px) {
  .note-row-main { overflow: hidden; }
  .note-row-excerpt { max-width: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.note-row-swatch { width: 15px; height: 15px; }

/* Notes en liste : la ligne entière prend la couleur de la note */
.note-list { gap: 8px; border: none; background: transparent; border-radius: 0; overflow: visible; }
.note-list li + li { border-top: none; }
.note-row { background: var(--nc-bg); border: 1.5px solid var(--nc-line); border-radius: var(--r-lg); color: var(--nc-ink); transition: transform .2s var(--ease-out), box-shadow .2s, filter .15s; }
.note-row:hover { background: var(--nc-bg); transform: translateY(-1px); box-shadow: var(--shadow-1); filter: saturate(1.08) brightness(.98); }
.note-row:active { background: var(--nc-bg); transform: scale(.995); }
.note-row-swatch { display: none; }
.note-row-title { color: var(--nc-ink); }
.note-row-excerpt, .note-row-meta, .note-row-free { color: var(--nc-muted); }
.note-row-meta .tag { border-color: var(--nc-ink); color: var(--nc-ink); }
.note-row-pin { color: var(--nc-ink); }
.note-row.nc-foret:hover { filter: brightness(1.12); }

/* ───────────── Priorités : palette validée (daltonisme, lisibilité) ───────────── */
:root { --p0: #6F8FD0; --p1: #2F9160; --p2: #EBA338; --p3: #FF3D7F; --p0-soft: #E6ECF8; --p1-soft: #DDEFE4; }
.task.tp-0 .check-box { border-color: #4F6FB0; }
.task.tp-1 .check-box { border-color: var(--p1); }
.cal-chip.cp-0 { background: #E3EAF7; }
.cal-chip.cp-1 { background: #D9EEE1; }

/* ───────────── Page Activité ───────────── */
.stats-page .page-head { align-items: flex-end; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--r-xl); background: var(--sand-light); border: 1.5px solid var(--line); min-width: 0; }
.tile-label { font-size: 14px; color: var(--muted); }
.tile-value { font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: 1; letter-spacing: -0.03em; color: var(--forest); }
.tile-value small { font-size: 18px; font-weight: 700; letter-spacing: 0; }
.tile-sub { font-size: 13px; color: var(--muted); }
.tile-list { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.tile-list b { font-family: var(--f-display); font-size: 20px; color: var(--forest); margin-right: 4px; }
.tile--hero { background: var(--forest); border-color: var(--forest); }
.tile--hero .tile-label { color: var(--muted-dark); }
.tile--hero .tile-value { font-size: 64px; color: var(--pink); }
.delta { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--forest-2); color: var(--sand); }
.delta .delta-ic { width: 14px; height: 14px; }
.delta.is-up .delta-ic { transform: rotate(-45deg); }
.delta.is-down .delta-ic { transform: rotate(-45deg); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.chart-wide { grid-column: span 3; }
.chart-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.chart-meta { font-size: 13px; color: var(--muted); }
.chart-meta b { color: var(--ink); }
.late-note { color: var(--pink-ink); font-weight: 600; }
.chart-host { width: 100%; min-height: 210px; }
.chart-host--heat { min-height: 0; overflow-x: auto; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .grid-line { stroke: #E2D7C3; stroke-width: 1; }
.chart-svg .axis-base { stroke: #BFB197; stroke-width: 1; }
.chart-svg .axis-text { font-family: var(--f-mono); font-size: 11px; fill: var(--muted); }
.chart-svg .axis-text.is-strong { fill: var(--ink); font-weight: 500; }
.chart-svg .hit { fill: transparent; cursor: default; }
.col-bar { fill: var(--forest); transform-box: fill-box; transform-origin: bottom; animation: col-grow .6s var(--ease-out) backwards; transition: fill .15s; }
.col-bar.is-today { fill: var(--pink); }
.col-group:hover .col-bar { fill: var(--forest-3); }
.col-group:hover .col-bar.is-today { fill: var(--pink-deep); }
.col-group:hover .hit { fill: rgba(31, 58, 46, .05); }
@keyframes col-grow { from { transform: scaleY(0); } }
.heat-cell { animation: fade-in .4s var(--ease-out) backwards; transition: transform .15s var(--ease-out); transform-box: fill-box; transform-origin: center; }
.heat-cell:hover { transform: scale(1.25); }
.h0 { fill: #E9E1D2; background: #E9E1D2; }
.h1 { fill: #CFE3D6; background: #CFE3D6; }
.h2 { fill: #A4CBB4; background: #A4CBB4; }
.h3 { fill: #6FA88A; background: #6FA88A; }
.h4 { fill: #3F7D5C; background: #3F7D5C; }
.h5 { fill: #1F3A2E; background: #1F3A2E; }
.heat-cell.is-today { stroke: var(--pink); stroke-width: 2; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); align-self: flex-end; }
.heat-legend span:first-child { margin-right: 4px; } .heat-legend span:last-child { margin-left: 4px; }
.heat-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.segbar { display: flex; gap: 2px; height: 28px; }
.seg-part { position: relative; display: flex; align-items: center; min-width: 4px; border-radius: 4px; color: var(--ink); font-size: 13px; font-weight: 700; padding-left: 8px; overflow: hidden; outline-offset: 2px; transition: filter .15s, transform .2s var(--ease-out); animation: seg-in .7s var(--ease-out) backwards; transform-origin: left; }
.seg-part:hover, .seg-part:focus-visible { filter: brightness(1.08); transform: translateY(-2px); }
@keyframes seg-in { from { transform: scaleX(0); } }
.p0 { background: var(--p0); } .p1 { background: var(--p1); } .p2 { background: var(--p2); } .p3 { background: var(--p3); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; color: var(--ink); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend b { color: var(--muted); font-weight: 500; }
.legend-key { width: 12px; height: 12px; border-radius: 3px; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; transition: background-color .15s; }
.hbar:hover { background: var(--sand-2); }
.hbar-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.hbar-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-name .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.hbar-track { display: block; height: 14px; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transform-origin: left; animation: seg-in .7s var(--ease-out) backwards; }
.hbar-fill.is-forest { background: var(--forest); }
.hbar-fill.is-sage { background: #3F7D5C; }
.hbar-val { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink); min-width: 28px; text-align: right; }
.meter--light { background: var(--sand-2); height: 8px; }
.chart-table summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 500; width: max-content; padding: 4px 0; }
.chart-table summary:hover { color: var(--ink); }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.chart-table th, .chart-table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); font-weight: 400; }
.chart-table thead th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chart-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-table { max-height: 320px; overflow: auto; }
.chart-tip { position: fixed; z-index: 120; pointer-events: none; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 10px; background: var(--forest-deep); color: var(--muted-dark); font-size: 12.5px; box-shadow: var(--shadow-2); max-width: 260px; }
.chart-tip strong { color: var(--sand); font-size: 14.5px; font-weight: 600; }
.journal { margin-top: 30px; }
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
  .tile { padding: 14px 16px; }
  .tile-value { font-size: 34px; }
  .tile--hero { grid-column: span 2; }
  .tile--hero .tile-value { font-size: 52px; }
}

.delta.is-down .delta-ic { transform: rotate(45deg); }
.hbar-name span:last-child { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.chart-host--heat svg { margin: 0 auto 0 0; }
.journal-more { margin-top: 22px; }
