@font-face { font-family: "Hanken Grotesk"; font-weight: 100 900; font-display: swap; src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-weight: 100 900; font-display: swap; src: url("/fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0B0B0C; --elev: #161618; --elev-2: #202023; --line: rgba(255,255,255,.07);
  --text: #F3F2EF; --dim: #8E8D93; --faint: #5C5C62;
  --accent: #FF7A45; --on-accent: #1A0D06;
  --shadow: 0 20px 50px -12px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.4);
  --ease: cubic-bezier(.22,1,.36,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F7F6F3; --elev: #FFFFFF; --elev-2: #EEEDE9; --line: rgba(0,0,0,.07);
    --text: #141414; --dim: #6B6A70; --faint: #A6A5AB;
    --accent: #E4572A; --on-accent: #FFFFFF;
    --shadow: 0 20px 50px -14px rgba(20,20,20,.22), 0 2px 6px rgba(20,20,20,.06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 16px/1.45 "Hanken Grotesk", system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; font-feature-settings: "ss01", "cv11"; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
svg { display: block; flex-shrink: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--elev-2) transparent; }

.app { max-width: 620px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top, 0px)) 22px calc(150px + var(--safe-b)); }

/* En-tête */
.top { margin-bottom: 26px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--elev); }
.seg button { position: relative; min-height: 34px; padding: 0 14px; border-radius: 9px; color: var(--dim); font-size: 14px; font-weight: 550; transition: color .2s, background .25s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-current="page"] { background: var(--elev-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.seg .n { margin-left: 6px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.seg button[aria-current="page"] .n { color: var(--dim); }
h1 { margin: 34px 0 0; font-size: 38px; font-weight: 650; line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
.brief { margin: 10px 0 0; max-width: 46ch; color: var(--dim); font-size: 16px; text-wrap: pretty; }
.brief:empty { display: none; }

/* Listes */
.group-label { margin: 26px 0 4px; font-size: 13px; font-weight: 600; color: var(--dim); }
.group-label.late { color: var(--accent); }
.group-label:first-child { margin-top: 0; }
.task { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; margin: 0 -12px; padding: 0 12px 0 0; border-radius: 14px; transition: background .2s; }
.task:hover { background: var(--elev); }
.check { width: 44px; height: 52px; display: grid; place-items: center; }
.check i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--faint); color: transparent; transition: box-shadow .2s, background .3s var(--ease), transform .3s var(--ease); }
.check:hover i { box-shadow: inset 0 0 0 1.5px var(--dim); }
.task.urgent .check i { box-shadow: inset 0 0 0 1.5px var(--accent); }
.check path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s var(--ease) .05s; }
.task.is-done .check i { background: var(--accent); box-shadow: none; color: var(--on-accent); transform: scale(1.06); }
.task.is-done .check path { stroke-dashoffset: 0; }
.task.is-done .t { color: var(--faint); }
.body { min-width: 0; padding: 14px 0; text-align: left; display: flex; flex-direction: column; gap: 2px; }
.t { font-size: 16.5px; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; transition: color .3s; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--dim)); }
.when { padding-left: 12px; font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.when.late, .task.urgent .when { color: var(--accent); }
.task.leaving { animation: leave .45s var(--ease) forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(16px); } }
.task.arriving { animation: arrive .5s var(--ease) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } }

.pending { display: flex; align-items: center; gap: 14px; height: 52px; color: var(--dim); }
.pending .dots { display: flex; gap: 4px; width: 22px; justify-content: center; }
.pending .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: blink 1s ease-in-out infinite; }
.pending .dots i:nth-child(2) { animation-delay: .15s; } .pending .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.pending span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { padding: 40px 0 0; color: var(--faint); font-size: 16px; }

.notice { display: block; margin-top: 30px; color: var(--accent); font-size: 14px; font-weight: 600; text-align: left; }
.notice:disabled { color: var(--dim); font-weight: 400; cursor: default; }

/* Saisie */
.composer { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 0 16px calc(16px + var(--safe-b)); pointer-events: none; }
.composer::before { content: ""; position: absolute; inset: -30px 0 0; background: linear-gradient(to top, var(--bg) 45%, transparent); z-index: -1; }
.bar { pointer-events: auto; max-width: 588px; margin: 0 auto; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 18px; border-radius: 18px; background: var(--elev); color: var(--dim); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transition: box-shadow .25s; }
.bar:focus-within { box-shadow: var(--shadow), inset 0 0 0 1px var(--faint); }
.bar input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: 0; color: var(--text); font-size: 16.5px; caret-color: var(--accent); }
.bar input::placeholder { color: var(--dim); }
.send { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: var(--on-accent); animation: arrive .25s var(--ease) both; }
.preview { pointer-events: none; max-width: 588px; min-height: 20px; margin: 8px auto 0; padding-left: 18px; font-size: 13px; color: var(--dim); }
.preview b { color: var(--text); font-weight: 600; }

/* Fiche */
.veil { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.45); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 460px; max-height: 88dvh; overflow-y: auto; padding: 18px 22px 24px; border-radius: 24px; background: var(--elev); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.sheet-top { display: flex; justify-content: space-between; }
.link { min-height: 36px; font-size: 15px; color: var(--dim); }
.link.strong { color: var(--accent); font-weight: 650; }
.link.danger:hover, .link.danger.armed { color: #FF5A5A; }
.title-edit { width: 100%; border: 0; background: none; padding: 0; resize: none; outline: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; overflow: hidden; }
.group { border-radius: 14px; background: var(--elev-2); padding: 4px 14px; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; font-size: 15px; }
.line span { color: var(--dim); }
.line input { min-width: 0; flex: 1; text-align: right; border: 0; background: none; outline: 0; font-size: 15px; color: var(--text); }
.line input::placeholder { color: var(--faint); }
.line input[type="datetime-local"] { max-width: 210px; }
.line input::-webkit-calendar-picker-indicator { filter: invert(.55); cursor: pointer; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 12px; }
.opts:empty { display: none; }
.opt { min-height: 32px; padding: 0 12px; border-radius: 9px; background: var(--elev); color: var(--dim); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.opt[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.opt.tag::before { margin: 0; }
.switch { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--faint); transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .3s var(--ease); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* Toast */
.toasts { position: fixed; z-index: 30; left: 0; right: 0; bottom: calc(100px + var(--safe-b)); display: flex; justify-content: center; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 16px; padding: 10px 10px 10px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 550; box-shadow: var(--shadow); pointer-events: auto; animation: arrive .35s var(--ease) both; }
.toast button { padding: 6px 10px; border-radius: 8px; color: var(--accent); font-weight: 700; }

/* Connexion */
.login { min-height: 100dvh; max-width: 320px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; }
.login img { border-radius: 16px; }
.field { width: 100%; height: 52px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--elev); outline: 0; font-size: 16px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.field:focus { box-shadow: inset 0 0 0 1px var(--faint); }
.login-err { margin: -8px 0 0; color: var(--accent); font-size: 14px; }

@media (max-width: 640px) {
  .app { padding-left: 18px; padding-right: 18px; }
  h1 { font-size: 34px; margin-top: 28px; }
  .veil { place-items: end stretch; padding: 0; }
  .sheet { max-width: none; border-radius: 24px 24px 0 0; padding-bottom: calc(24px + var(--safe-b)); animation-name: up; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
