/* Agenda JP — design JPI : bulles, verre, dégradés bleu → violet, accents corail et or. */
:root {
  --bg: #f3f1ff;
  --bg-2: #e9e6ff;
  --card: rgba(255, 255, 255, .78);
  --card-solid: #ffffff;
  --glass-line: rgba(255, 255, 255, .9);
  --line: rgba(76, 64, 160, .12);
  --line-2: rgba(76, 64, 160, .22);
  --ink: #17152b;
  --ink-2: #4a4766;
  --ink-3: #8b88a6;
  --blue: #3b82f6;
  --violet: #8b5cf6;
  --cyan: #22c3ee;
  --coral: #ff6b5b;
  --amber: #ffad3b;
  --gold: #d4a853;
  --mint: #12c48b;
  --pink: #ff4d8d;
  --pro: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --perso: linear-gradient(135deg, #ff6b5b, #ffad3b);
  --brand: linear-gradient(120deg, #3b82f6 0%, #8b5cf6 55%, #22c3ee 100%);
  --pro-soft: rgba(99, 102, 241, .12);
  --perso-soft: rgba(255, 120, 80, .14);
  --mint-soft: rgba(18, 196, 139, .14);
  --sel: #6d5dfc;
  --sel-soft: rgba(109, 93, 252, .18);
  --shadow: 0 2px 4px rgba(40, 30, 120, .04), 0 12px 30px -14px rgba(60, 40, 160, .28);
  --shadow-lg: 0 24px 60px -20px rgba(60, 40, 160, .45);
  --r: 20px;
  --display: 'Unbounded', 'Figtree', system-ui, sans-serif;
  --sans: 'Figtree', -apple-system, 'Helvetica Neue', sans-serif;
  --hour: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --blob-op: .55;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0a18; --bg-2: #13112a; --card: rgba(255, 255, 255, .06); --card-solid: #18162f; --glass-line: rgba(255, 255, 255, .08);
    --line: rgba(190, 180, 255, .1); --line-2: rgba(190, 180, 255, .2);
    --ink: #f3f1ff; --ink-2: #c3bfe0; --ink-3: #8682a8;
    --pro-soft: rgba(129, 140, 248, .18); --perso-soft: rgba(255, 140, 100, .16); --mint-soft: rgba(18, 196, 139, .18);
    --sel: #9d8cff; --sel-soft: rgba(157, 140, 255, .22);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    --blob-op: .38;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0a18; --bg-2: #13112a; --card: rgba(255, 255, 255, .06); --card-solid: #18162f; --glass-line: rgba(255, 255, 255, .08);
  --line: rgba(190, 180, 255, .1); --line-2: rgba(190, 180, 255, .2);
  --ink: #f3f1ff; --ink-2: #c3bfe0; --ink-3: #8682a8;
  --pro-soft: rgba(129, 140, 248, .18); --perso-soft: rgba(255, 140, 100, .16); --mint-soft: rgba(18, 196, 139, .18);
  --sel: #9d8cff; --sel-soft: rgba(157, 140, 255, .22);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
  --blob-op: .38;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 15.5px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
/* Taches de couleur animées en fond */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: var(--blob-op); pointer-events: none;
}
body::before {
  width: 620px; height: 620px; left: -160px; top: -200px;
  background: radial-gradient(circle at 30% 30%, #6c8cff, transparent 62%), radial-gradient(circle at 70% 70%, #a78bfa, transparent 60%);
  animation: drift1 26s ease-in-out infinite alternate;
}
body::after {
  width: 560px; height: 560px; right: -180px; bottom: -160px;
  background: radial-gradient(circle at 40% 40%, #22d3ee, transparent 60%), radial-gradient(circle at 65% 60%, #ff8a6b, transparent 58%);
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(180px, 120px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-200px, -140px) scale(1.1); } }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* —— Haut de page —— */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; padding: calc(14px + var(--safe-t)) 22px 12px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { flex: none; display: grid; place-items: center; width: 62px; height: 46px; border-radius: 16px; background: #0d0b1f; box-shadow: var(--shadow); }
.brand img { width: 50px; height: auto; display: block; }
.date-block { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.big-date { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.05; letter-spacing: -.02em; white-space: nowrap; }
.big-date em { font-style: normal; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.clocks { display: flex; gap: 6px; font-size: 12.5px; margin-top: 4px; }
.clocks span { padding: 2px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.clocks b { color: var(--ink); font-weight: 700; }
.spacer { flex: 1; }
.seg { position: relative; display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.seg button { border: 0; background: none; padding: 7px 15px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: color .2s, background .25s, transform .15s; }
.seg button:active { transform: scale(.95); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px rgba(109, 93, 252, .8); }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); width: 40px; height: 40px; border-radius: 999px;
  display: inline-grid; place-items: center; color: var(--ink-2); box-shadow: var(--shadow); transition: transform .15s, color .15s; font-size: 18px;
}
.icon-btn:hover { color: var(--sel); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 19px; height: 19px; }
.nav { display: inline-flex; gap: 6px; align-items: center; }
.nav .today-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 14px; font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow); }

/* —— Saisie rapide —— */
.quick { margin-top: 12px; position: relative; }
.quick::before {
  content: ''; position: absolute; left: -2px; right: -2px; top: -2px; height: 54px; border-radius: 24px; background: var(--brand); opacity: 0; transition: opacity .25s; z-index: 0;
  background-size: 200% 200%; animation: flow 6s linear infinite;
}
.quick:focus-within::before { opacity: 1; }
@keyframes flow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.quick input {
  position: relative; z-index: 1; width: 100%; height: 50px; border: 1px solid var(--line-2); background: var(--card-solid); border-radius: 22px;
  padding: 0 56px 0 52px; font-size: 16px; outline: none; box-shadow: var(--shadow);
}
.quick .plus {
  position: absolute; z-index: 2; left: 9px; top: 8px; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 20px; font-weight: 700; pointer-events: none; box-shadow: 0 6px 14px -6px rgba(109, 93, 252, .9);
}
.quick .mic { position: absolute; z-index: 2; right: 8px; top: 8px; width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--bg-2); font-size: 16px; transition: transform .15s; }
.quick .mic:active { transform: scale(.9); }
.quick .mic.on { background: var(--coral); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 107, 91, .22); } }
.preview { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 13px; }
.preview:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; animation: chipIn .25s cubic-bezier(.2, 1.4, .4, 1) both;
}
.chip:nth-child(2) { animation-delay: .03s; } .chip:nth-child(3) { animation-delay: .06s; } .chip:nth-child(4) { animation-delay: .09s; }
@keyframes chipIn { from { opacity: 0; transform: scale(.7); } }
.chip.task { background: var(--mint-soft); color: var(--mint); border-color: transparent; }
.chip.event { background: var(--pro); color: #fff; border-color: transparent; }
.chip.warn { background: var(--perso-soft); color: var(--coral); border-color: transparent; }

main { flex: 1; padding: 20px 22px calc(120px + var(--safe-b)); }

/* —— Vue Aujourd'hui —— */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; max-width: 1200px; margin: 0 auto; }
.section { margin-bottom: 28px; }
.section h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.section h2 small { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 2px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.section h2 .act { margin-left: auto; font-family: var(--sans); font-size: 13px; border: 0; background: var(--sel-soft); color: var(--sel); font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.section.late h2, .section.caser h2 { color: var(--coral); }
.list { display: flex; flex-direction: column; gap: 8px; }
.list > * { animation: pop .38s cubic-bezier(.2, 1.3, .4, 1) both; }
.list > *:nth-child(2) { animation-delay: .03s; } .list > *:nth-child(3) { animation-delay: .06s; } .list > *:nth-child(4) { animation-delay: .09s; }
.list > *:nth-child(5) { animation-delay: .12s; } .list > *:nth-child(n+6) { animation-delay: .15s; }
.no-anim .list > *, .no-anim .chip { animation: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.empty { color: var(--ink-3); font-size: 14px; padding: 16px 18px; border: 2px dashed var(--line-2); border-radius: var(--r); background: color-mix(in srgb, var(--card) 50%, transparent); }

.row {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px 13px 14px;
  background: var(--card); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer;
  transition: transform .18s cubic-bezier(.2, 1.3, .4, 1), box-shadow .18s, opacity .25s;
}
.row::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--pro); }
.row.perso::before { background: var(--perso); }
.row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.row:active { transform: scale(.985); }
.row.selected { box-shadow: 0 0 0 3px var(--sel), var(--shadow-lg); }
.row.event { background: var(--pro); color: #fff; border-color: transparent; }
.row.event.perso { background: var(--perso); }
.row.event::before { display: none; }
.row.event .time, .row.event .time small, .row.event .meta { color: rgba(255, 255, 255, .9); }
.row.event .tag { background: rgba(255, 255, 255, .22); color: #fff; }
.row.done { opacity: .5; }
.row.done .title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--mint); }
.row .time { width: 62px; flex: none; font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14.5px; padding-top: 1px; }
.row .time small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.row .body { flex: 1; min-width: 0; }
.row .title { font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.row .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-weight: 700; font-size: 12px; }
.tag.rolled { background: var(--perso-soft); color: var(--coral); }
.tag.pro { background: var(--pro-soft); color: var(--violet); }
.tag.perso { background: var(--perso-soft); color: #e8663b; }
.check {
  position: relative; flex: none; width: 28px; height: 28px; margin-top: -2px; border-radius: 999px; border: 2.5px solid var(--line-2);
  background: var(--card-solid); display: grid; place-items: center; padding: 0; transition: transform .2s cubic-bezier(.2, 1.6, .4, 1), background .2s, border-color .2s;
}
.check:hover { border-color: var(--mint); transform: scale(1.08); }
.check.on { background: var(--mint); border-color: var(--mint); color: #fff; animation: boing .45s cubic-bezier(.2, 1.8, .4, 1); }
.check.on::after { content: '✓'; font-size: 15px; font-weight: 900; }
@keyframes boing { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.ev-dot { flex: none; width: 28px; height: 28px; border-radius: 999px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-size: 14px; }
.now-line { display: flex; align-items: center; gap: 8px; color: var(--pink); font-size: 12px; font-weight: 800; margin: 2px 0; }
.now-line::before { content: ''; width: 10px; height: 10px; border-radius: 99px; background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 77, 141, .2); animation: beat 2s ease-in-out infinite; }
.now-line::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--pink), transparent); border-radius: 2px; }
@keyframes beat { 50% { box-shadow: 0 0 0 7px rgba(255, 77, 141, .08); } }
.collapse { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 13px; font-weight: 700; padding: 7px 13px; border-radius: 999px; margin-top: 10px; }

.side .card { background: var(--card); border: 1px solid var(--glass-line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.side .card h3 { margin: 0 0 10px; font-family: var(--display); font-weight: 600; font-size: 14px; }
.side .card.hero { background: var(--brand); color: #fff; border: 0; box-shadow: 0 18px 40px -18px rgba(109, 93, 252, .9); }
.side .card.hero h3 { color: #fff; }
.side .card.hero .stat { border-color: rgba(255, 255, 255, .22); }
.stat { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 14px; border-top: 1px solid var(--line); }
.stat:first-of-type { border-top: 0; }
.stat b { font-family: var(--display); font-size: 17px; font-variant-numeric: tabular-nums; }
.ring { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.ring svg { width: 66px; height: 66px; transform: rotate(-90deg); flex: none; }
.ring circle { transition: stroke-dashoffset .8s cubic-bezier(.2, 1, .3, 1); }
.ring .pct { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1; }
.ring small { display: block; font-size: 12.5px; opacity: .9; font-weight: 600; margin-top: 4px; }
.hint { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.hint b { color: var(--ink); }
kbd { font: 700 11.5px var(--sans); padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); }

/* —— Vue Semaine —— */
.week { background: var(--card); border: 1px solid var(--glass-line); border-radius: 24px; overflow: clip; box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.week-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.week-head .d { padding: 10px 10px 9px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.week-head .d .n { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1; min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; flex: none; }
.week-head .d .w { font-size: 13px; color: var(--ink-2); text-transform: capitalize; font-weight: 600; }
.week-head .d .c { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--violet); background: var(--pro-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.week-head .d .c:empty { display: none; }
.week-head .d.is-today .n { color: #fff; background: var(--brand); box-shadow: 0 6px 16px -6px rgba(109, 93, 252, .9); }
.week-head .d.is-past { opacity: .5; }
.week-band { position: relative; z-index: 4; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 55%, transparent); }
.band-label { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--coral); padding: 10px 6px 0 0; text-align: right; font-weight: 800; line-height: 1.2; }
.band-cell { border-left: 1px solid var(--line); padding: 5px; min-height: 38px; max-height: 134px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.band-cell.is-today { background: rgba(255, 107, 91, .07); }
.chipit {
  position: relative; display: flex; gap: 6px; align-items: flex-start; font-size: 12px; font-weight: 600; line-height: 1.25; padding: 5px 8px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 12px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  box-shadow: 0 3px 8px -4px rgba(60, 40, 160, .3); transition: transform .15s; flex: none;
}
.chipit:hover { transform: translateY(-1px); }
.chipit .lbl { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.chipit.rolled .lbl::before, .it.rolled .lbl::before { content: '↻ '; color: var(--coral); font-weight: 900; }
.chipit.done, .it.done { opacity: .45; } .chipit.done .lbl, .it.done .lbl { text-decoration: line-through; }
.chipit.selected, .it.selected { outline: 2.5px solid var(--sel); outline-offset: 1px; z-index: 6; }
.chipit.dragging, .it.dragging { z-index: 20; box-shadow: 0 16px 30px -10px rgba(60, 40, 160, .55); cursor: grabbing; }
.mini-check { flex: none; width: 14px; height: 14px; margin-top: 1px; border-radius: 99px; border: 2px solid var(--ink-3); background: none; padding: 0; transition: transform .15s; }
.mini-check:hover { transform: scale(1.25); border-color: var(--mint); }
.done .mini-check { background: var(--mint); border-color: var(--mint) !important; }
.chipit.pro .mini-check, .it.task.pro .mini-check { border-color: var(--blue); }
.chipit.perso .mini-check, .it.task.perso .mini-check { border-color: var(--coral); }

.week-scroll { position: relative; height: calc(100vh - 300px); min-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.week-body { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.hours div { height: var(--hour); position: relative; font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: right; padding-right: 9px; font-variant-numeric: tabular-nums; }
.hours div span { position: relative; top: -8px; }
.col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour); }
.col.is-past { background-color: color-mix(in srgb, var(--bg-2) 40%, transparent); }
.col.is-today { background-color: rgba(139, 92, 246, .06); }
.col .half { position: absolute; left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--line) 60%, transparent); pointer-events: none; }
.now-bar { position: absolute; left: 0; right: 0; height: 2.5px; background: var(--pink); z-index: 6; pointer-events: none; box-shadow: 0 0 10px rgba(255, 77, 141, .6); }
.now-bar::before { content: ''; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 999px; background: var(--pink); box-shadow: 0 0 0 4px rgba(255, 77, 141, .25); }
.it {
  position: absolute; z-index: 3; border-radius: 12px; padding: 4px 8px 4px 7px; font-size: 12.5px; font-weight: 600; line-height: 1.25;
  overflow: hidden; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  display: flex; gap: 6px; align-items: flex-start; transition: box-shadow .15s;
}
.it.task { background: var(--card-solid); border: 1px solid var(--line); color: var(--ink); box-shadow: 0 3px 10px -5px rgba(60, 40, 160, .35); }
.it.task.pro { background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--pro) border-box; border: 1.5px solid transparent; }
.it.task.perso { background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--perso) border-box; border: 1.5px solid transparent; }
.it.event { background: var(--pro); color: #fff; border: 0; box-shadow: 0 8px 18px -8px rgba(109, 93, 252, .9); }
.it.event.perso { background: var(--perso); box-shadow: 0 8px 18px -8px rgba(255, 107, 91, .8); }
.it .lbl { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.it.event .lbl { -webkit-line-clamp: 3; }
.it .tm { font-weight: 800; opacity: .7; font-variant-numeric: tabular-nums; margin-right: 3px; }
.it:hover { z-index: 5; box-shadow: 0 12px 24px -10px rgba(60, 40, 160, .55); }
.lasso { position: absolute; z-index: 9; border: 2px solid var(--sel); background: var(--sel-soft); border-radius: 10px; pointer-events: none; }

/* Semaine en liste (téléphone) et historique */
.agenda-day { margin-bottom: 24px; }
.agenda-day h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--display); font-weight: 600; font-size: 17px; text-transform: capitalize; }
.agenda-day h3 small { font-family: var(--sans); font-size: 12px; font-weight: 700; color: var(--violet); background: var(--pro-soft); padding: 2px 9px; border-radius: 999px; text-transform: none; }
.agenda-day h3 small:empty { display: none; }
.agenda-day.is-today h3 { color: var(--violet); }

/* —— Listes à cocher —— */
.cl { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.cl-item { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 6px; text-align: left; font-size: 15px; font-weight: 500; color: var(--ink); border-radius: 10px; width: 100%; transition: background .15s; }
.cl-item:hover { background: var(--bg-2); }
.cl-item .box { flex: none; width: 20px; height: 20px; border-radius: 7px; border: 2.5px solid var(--line-2); display: grid; place-items: center; transition: all .2s cubic-bezier(.2, 1.6, .4, 1); }
.cl-item.on { color: var(--ink-3); }
.cl-item.on span:last-child { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--mint); }
.cl-item.on .box { background: var(--mint); border-color: var(--mint); transform: rotate(-8deg); }
.cl-item.on .box::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 900; }
.cl-line { display: flex; align-items: center; gap: 4px; }
.cl-del { border: 0; background: none; color: var(--ink-3); padding: 4px 9px; border-radius: 999px; }
.cl-del:hover { color: var(--coral); background: var(--perso-soft); }
.cl-edit:empty { display: none; }
.history { max-width: 860px; margin: 0 auto; }
.history input[type="search"] { width: 100%; border: 1px solid var(--line-2); background: var(--card-solid); border-radius: 18px; padding: 13px 16px; font-size: 16px; margin-bottom: 20px; outline: none; box-shadow: var(--shadow); }
.history input[type="search"]:focus { border-color: var(--sel); box-shadow: 0 0 0 4px var(--sel-soft); }

/* —— Choix d'un jour / d'une répétition au doigt —— */
.days { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.days::-webkit-scrollbar { display: none; }
.day-btn {
  flex: none; scroll-snap-align: start; min-width: 62px; padding: 9px 10px; border-radius: 18px; border: 1.5px solid var(--line-2);
  background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 600; transition: transform .15s;
}
.day-btn:active { transform: scale(.92); }
.day-btn .dw { font-size: 11.5px; color: var(--ink-3); text-transform: capitalize; }
.day-btn .dn { font-family: var(--display); font-size: 18px; line-height: 1.1; }
.day-btn.wide { min-width: auto; padding: 9px 14px; justify-content: center; }
.day-btn.wide .dn { font-family: var(--sans); font-size: 14px; font-weight: 700; }
.day-btn[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: transparent; }
.day-btn[aria-pressed="true"] .dw { color: rgba(255, 255, 255, .85); }
.day-btn.cal { position: relative; overflow: hidden; }
.day-btn.cal input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* —— Barre de sélection —— */
.selbar {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%) translateY(160%) scale(.9);
  z-index: 50; display: flex; align-items: center; gap: 2px; padding: 6px; max-width: calc(100vw - 20px);
  background: #15122e; color: #fff; border-radius: 999px; box-shadow: 0 20px 50px -14px rgba(40, 20, 120, .7);
  transition: transform .3s cubic-bezier(.2, 1.4, .4, 1); overflow-x: auto; scrollbar-width: none; border: 1px solid rgba(255, 255, 255, .1);
}
.selbar::-webkit-scrollbar { display: none; }
.selbar.show { transform: translateX(-50%) translateY(0) scale(1); }
.selbar .count { padding: 7px 13px; font-weight: 800; white-space: nowrap; font-size: 13.5px; background: var(--brand); border-radius: 999px; margin-right: 4px; }
.selbar button, .selbar label {
  border: 0; background: transparent; color: inherit; padding: 9px 12px; border-radius: 999px; white-space: nowrap; font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; position: relative; transition: background .15s;
}
.selbar button:hover, .selbar label:hover { background: rgba(255, 255, 255, .12); }
.selbar .sep { width: 1px; align-self: stretch; margin: 8px 3px; background: rgba(255, 255, 255, .16); }
.selbar .danger { color: #ff9c8f; }

/* —— Feuilles —— */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 10, 40, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--card-solid); color: var(--ink);
  border-radius: 28px; padding: 22px 22px calc(20px + var(--safe-b)); box-shadow: var(--shadow-lg); animation: sheetIn .32s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes sheetIn { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.sheet h2 { margin: 0 0 16px; font-family: var(--display); font-weight: 600; font-size: 22px; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); font-weight: 800; margin-bottom: 7px; }
.field > label span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field select, .field textarea, .login input {
  width: 100%; border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 14px; padding: 11px 13px; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, .login input:focus { border-color: var(--sel); box-shadow: 0 0 0 4px var(--sel-soft); }
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; transition: transform .15s; }
.chips button:active { transform: scale(.93); }
.chips button[aria-pressed="true"] { background: var(--brand); border-color: transparent; color: #fff; }
.sheet .seg { width: 100%; box-shadow: none; } .sheet .seg button { flex: 1; }
.sheet-actions { display: flex; gap: 8px; margin-top: 20px; align-items: center; }
.btn { border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 999px; padding: 12px 20px; font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .15s; }
.btn:active { transform: scale(.95); }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -10px rgba(109, 93, 252, .9); }
.btn.danger { color: var(--coral); }
.btn.ghost { border-color: transparent; background: none; }
.status-line { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-radius: 16px; background: var(--bg); margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.status-line .dot { width: 10px; height: 10px; border-radius: 99px; background: var(--ink-3); flex: none; }
.status-line .dot.ok { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); } .status-line .dot.ko { background: var(--coral); box-shadow: 0 0 0 4px var(--perso-soft); }

/* —— Connexion —— */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .box { width: min(400px, 100%); text-align: center; background: var(--card); border: 1px solid var(--glass-line); border-radius: 32px; padding: 34px 28px; box-shadow: var(--shadow-lg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.login .logo { width: 150px; margin: 0 auto 16px; padding: 16px 18px; border-radius: 24px; background: #0d0b1f; box-shadow: 0 16px 40px -16px rgba(109, 93, 252, .8); }
.login .logo img { width: 100%; display: block; }
.login h1 { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
.login h1 em { font-style: normal; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login p { color: var(--ink-2); margin: 0 0 22px; }
.login input { text-align: center; margin-bottom: 12px; font-size: 18px; }
.login .btn { width: 100%; }
.login .err { color: var(--coral); min-height: 20px; margin-top: 10px; font-size: 14px; font-weight: 600; }

/* —— Toast —— */
#toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(24px) scale(.9); opacity: 0;
  z-index: 70; background: var(--card-solid); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 18px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 600;
  transition: all .3s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); pointer-events: auto; }
#toast button { border: 0; background: var(--brand); color: #fff; font-weight: 800; border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
#toast span:only-child { padding: 3px 10px 3px 0; }

/* —— Confettis —— */
.confetti { position: fixed; z-index: 80; pointer-events: none; width: 8px; height: 8px; border-radius: 3px; animation: burst .8s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.4); opacity: 0; } }

/* —— Téléphone —— */
@media (max-width: 760px) {
  .top { padding: calc(10px + var(--safe-t)) 14px 10px; }
  .brand { width: 50px; height: 38px; border-radius: 13px; } .brand img { width: 40px; }
  .big-date { font-size: 21px; }
  .top-row { gap: 10px; }
  .top-row .spacer { display: none; }
  .top-tools { display: flex; width: 100%; gap: 8px; align-items: center; }
  .top-tools .seg { flex: 1; } .top-tools .seg button { flex: 1; padding: 8px 4px; font-size: 13px; }
  .top-tools .nav .today-btn { display: none; }
  main { padding: 16px 14px calc(120px + var(--safe-b)); }
  .today-grid { grid-template-columns: 1fr; gap: 0; }
  .side { order: -1; }
  .side .card.stats { display: none; }
  .row .time { width: 52px; font-size: 13.5px; }
  .selbar { left: 10px; right: 10px; transform: translateY(160%); max-width: none; border-radius: 24px; }
  .selbar.show { transform: translateY(0); }
  .backdrop { align-items: flex-end; }
  .sheet { border-radius: 28px 28px 0 0; max-height: 92vh; animation: slide .3s cubic-bezier(.2, 1.1, .4, 1); }
  @keyframes slide { from { transform: translateY(50%); } }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .field:last-child { grid-column: 1 / -1; }
  body::before { width: 380px; height: 380px; } body::after { width: 340px; height: 340px; }
}
@media (min-width: 761px) { .top-tools { display: contents; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.selbar:not(.show) { visibility: hidden; transition: transform .3s, visibility 0s .3s; }
@media (max-width: 760px) { .row .time:has(small:only-child) { width: auto; min-width: 0; } }

/* —— Deux personnes —— */
.who { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.who.j { background: var(--pro); } .who.f { background: linear-gradient(135deg, #ff4d8d, #ffad3b); }
.row.event .who { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.who-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px 5px 6px; box-shadow: var(--shadow); font-size: 13.5px; }
.who-btn .who + .who { margin-left: -8px; box-shadow: 0 0 0 2px var(--card-solid); }
.who-btn b { margin-left: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wolt-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 800;
  color: #fff; background: #00a2e8; box-shadow: 0 8px 18px -8px rgba(0, 162, 232, .9); text-decoration: none; transition: transform .15s;
}
.wolt-btn:active { transform: scale(.94); }
.btn[disabled] { opacity: .45; pointer-events: none; }
@media (max-width: 760px) { .who-btn b { display: none; } .who-btn { padding: 5px 7px; } }

/* —— Les 3 types, bien distincts —— */
.row.event, .row.event.perso { background: var(--pro); color: #fff; }
.row.is-list { background: linear-gradient(135deg, rgba(18, 196, 139, .16), rgba(34, 195, 238, .12)), var(--card-solid); border-color: rgba(18, 196, 139, .35); }
.row.is-list::before { background: linear-gradient(180deg, #12c48b, #22c3ee); }
.tag.type-event { background: rgba(255, 255, 255, .25); color: #fff; }
.tag.type-task { background: var(--pro-soft); color: var(--violet); }
.tag.type-list { background: rgba(18, 196, 139, .18); color: #0b8f66; }
:root[data-theme="dark"] .tag.type-list { color: #5fe0b5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.type-list { color: #5fe0b5; } }
.it.event, .it.event.perso { background: var(--pro); color: #fff; box-shadow: 0 8px 18px -8px rgba(109, 93, 252, .9); }
.it.task.is-list, .chipit.is-list { background: linear-gradient(135deg, #dff8ee, #d6f3fb) padding-box, linear-gradient(135deg, #12c48b, #22c3ee) border-box; border: 1.5px solid transparent; color: #0b5d45; }
:root[data-theme="dark"] .it.task.is-list, :root[data-theme="dark"] .chipit.is-list { background: linear-gradient(135deg, #0f3a30, #0f2f3a) padding-box, linear-gradient(135deg, #12c48b, #22c3ee) border-box; color: #bff3e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .it.task.is-list, :root:not([data-theme="light"]) .chipit.is-list { background: linear-gradient(135deg, #0f3a30, #0f2f3a) padding-box, linear-gradient(135deg, #12c48b, #22c3ee) border-box; color: #bff3e1; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.legend.col { flex-direction: column; align-items: flex-start; margin: 0; }
.lg { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.lg.event { background: var(--pro); color: #fff; }
.lg.task { background: var(--card-solid); border: 1.5px solid var(--line-2); color: var(--ink); }
.lg.list { background: linear-gradient(135deg, #dff8ee, #d6f3fb); color: #0b5d45; border: 1.5px solid rgba(18, 196, 139, .45); }
.legend.col .lg { font-weight: 600; font-size: 12.5px; }
.lg-hint { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* —— Glisser : bulle fantôme + case d'arrivée —— */
.drag-src { opacity: .28 !important; }
.ghost { box-shadow: 0 22px 40px -12px rgba(60, 40, 160, .6) !important; opacity: .96; transition: none !important; outline: 2.5px solid var(--sel); }
.ghost-count { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.drop-hint {
  position: absolute; left: 3px; right: 3px; z-index: 25; border-radius: 12px; pointer-events: none;
  border: 2.5px dashed var(--sel); background: var(--sel-soft); display: flex; align-items: flex-start; justify-content: flex-start;
}
.drop-hint span { margin: -12px 0 0 6px; background: var(--sel); color: #fff; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow); }
.drop-hint.band { position: relative; left: auto; right: auto; min-height: 28px; flex: none; align-items: center; }
.drop-hint.band span { margin: 0 0 0 6px; }
.slot-hover {
  position: absolute; left: 3px; right: 3px; height: calc(var(--hour) / 2); z-index: 2; pointer-events: none; border-radius: 10px;
  background: var(--sel-soft); color: var(--sel); font-size: 11px; font-weight: 800; padding: 3px 8px; white-space: nowrap; overflow: hidden;
}

/* —— Création rapide —— */
.backdrop.light { background: rgba(15, 10, 40, .22); }
.create-pop { width: min(520px, 100%); }
.create-title { width: 100%; border: 0; border-bottom: 2px solid var(--line-2); background: none; font-family: var(--display); font-size: 20px; font-weight: 600; padding: 12px 2px; margin: 4px 0 14px; outline: none; }
.create-title:focus { border-color: var(--sel); }
.create-title.shake { animation: shake .35s; border-color: var(--coral); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.create-kind { width: 100%; margin-bottom: 12px; box-shadow: none; } .create-kind button { flex: 1; }
.create-list { width: 100%; min-height: 70px; border: 1.5px solid rgba(18, 196, 139, .5); background: rgba(18, 196, 139, .06); border-radius: 14px; padding: 10px 12px; font-size: 15px; outline: none; margin-bottom: 12px; resize: vertical; }
.create-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.mini { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.mini input { border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 12px; padding: 7px 10px; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 600; }
.mini-label { font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin: 4px 0 7px; }
.create-pop .chips { margin-bottom: 10px; }
.create-when .days { margin-bottom: 4px; }

/* —— Menu clic droit —— */
.ctx { position: fixed; z-index: 90; min-width: 190px; padding: 6px; background: var(--card-solid); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); animation: chipIn .18s cubic-bezier(.2, 1.4, .4, 1); }
.ctx button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.ctx button:hover { background: var(--sel-soft); color: var(--sel); }
.ctx .danger { color: var(--coral); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* —— Bouton + (téléphone) —— */
.fab { display: none; }
@media (max-width: 760px) {
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(22px + var(--safe-b)); z-index: 45; width: 60px; height: 60px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-size: 30px; font-weight: 600; box-shadow: 0 14px 30px -10px rgba(109, 93, 252, .95); }
  .fab:active { transform: scale(.92); }
  .lg-hint { display: none; }
}

/* —— Une couleur par type, plus de cadres Pro/Perso —— */
.row::before { display: none; }
.row.is-list::before { display: block; background: linear-gradient(180deg, #12c48b, #22c3ee); }
.it.task.pro, .it.task.perso { background: var(--card-solid); border: 1.5px solid var(--line-2); }
.chipit.pro, .chipit.perso { box-shadow: 0 3px 8px -4px rgba(60, 40, 160, .3); }
.chipit.pro .mini-check, .chipit.perso .mini-check, .it.task.pro .mini-check, .it.task.perso .mini-check { border-color: var(--ink-3); }
.tag.pro, .tag.perso { background: var(--bg-2); color: var(--ink-3); font-weight: 600; }
.row.event .tag.pro, .row.event .tag.perso { background: rgba(255, 255, 255, .2); color: #fff; }
/* Filtres par type */
.legend button.lg { cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s; }
.legend button.lg:active { transform: scale(.94); }
.legend .lg-title { font-size: 12px; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.legend .lg.all { background: var(--card-solid); border: 1.5px solid var(--line-2); color: var(--ink); }
.legend .lg[aria-pressed="false"] { opacity: .55; }
.legend .lg[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 0 3px var(--sel-soft), 0 6px 14px -8px rgba(60, 40, 160, .6); }
.legend .lg.all[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.today-grid .legend { margin-bottom: 18px; }

/* —— « À caser » : bandeau horizontal en haut de la semaine —— */
.tray { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255, 107, 91, .08), rgba(255, 173, 59, .06)); min-height: 54px; }
.tray-title { flex: 0 0 auto; font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--coral); display: flex; flex-direction: column; padding-top: 4px; }
.tray-title small { font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.tray-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.tray-group.is-past { opacity: .7; }
.tray-day { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 4px 4px 4px 0; text-transform: capitalize; }
.tray .chipit { max-width: 240px; font-size: 12.5px; padding: 6px 10px; }
.tray .chipit .lbl { -webkit-line-clamp: 1; white-space: nowrap; text-overflow: ellipsis; display: block; }
.tray-empty { font-size: 13px; color: var(--ink-3); font-weight: 600; padding-top: 6px; }
.tray .drop-hint.band { min-width: 150px; height: 32px; }

/* —— Aujourd'hui : « à caser » en cartes côte à côte —— */
.list.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.list.cards .row { padding: 12px 12px 10px; }
.list.cards .row .time { display: none; }
.list.cards .row .title { font-size: 14.5px; }
@media (max-width: 760px) { .list.cards { grid-template-columns: 1fr 1fr; gap: 8px; } .list.cards .row { padding: 10px; gap: 8px; } .list.cards .row .check { width: 24px; height: 24px; } }

/* ===== En-tête compact : tout sur une ligne (ordinateur) ===== */
.top { padding: calc(8px + var(--safe-t)) 16px 8px; }
.top-row { flex-wrap: nowrap; gap: 12px; align-items: center; }
.brand { width: 46px; height: 36px; border-radius: 12px; } .brand img { width: 38px; }
.date-block { flex: none; gap: 0; }
.big-date { font-size: 20px; letter-spacing: -.02em; }
.date-block .sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; margin-top: 2px; }
.date-block .sub .eyebrow { font-size: 11.5px; letter-spacing: 0; text-transform: none; font-weight: 700; }
.date-block .sub b { color: var(--ink-2); font-weight: 700; }
.quick { flex: 1 1 auto; min-width: 220px; margin: 0; }
.quick input { height: 42px; border-radius: 16px; padding: 0 48px 0 46px; font-size: 15px; }
.quick::before { height: 46px; border-radius: 18px; }
.quick .plus { left: 6px; top: 6px; width: 30px; height: 30px; font-size: 18px; border: 0; pointer-events: auto; cursor: pointer; }
.quick .mic { top: 6px; right: 6px; width: 30px; height: 30px; font-size: 14px; }
.preview {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; margin: 0; padding: 8px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.top-tools { display: flex !important; align-items: center; gap: 8px; flex: none; }
.seg { padding: 3px; } .seg button { padding: 6px 12px; font-size: 13px; }
.icon-btn { width: 36px; height: 36px; }
.nav .today-btn { padding: 7px 11px; font-size: 12.5px; }
.nav .icon-btn { width: 32px; height: 32px; }
.who-btn { padding: 4px 10px 4px 5px; font-size: 12.5px; }
.tfilter { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tfilter .lg { border: 0; padding: 5px 9px; font-size: 13px; border-radius: 999px; background: none; color: var(--ink-2); opacity: 1; box-shadow: none; cursor: pointer; }
.tfilter .lg.all { background: none; border: 0; font-weight: 700; }
.tfilter .lg[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: none; }
.tfilter .lg.all[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
main { padding-top: 10px; }
.legend { display: none; }
.side .legend { display: flex; }

/* Semaine plus compacte */
.week-head .d { padding: 6px 10px; }
.week-head .d .n { font-size: 16px; min-width: 30px; height: 30px; }
.tray { flex-wrap: nowrap; overflow-x: auto; padding: 7px 12px; min-height: 0; gap: 10px; align-items: center; scrollbar-width: thin; }
.tray-title { padding: 0; font-size: 13px; white-space: nowrap; }
.tray-group { flex: none; flex-wrap: nowrap; }
.tray .chipit { flex: none; max-width: 260px; padding: 5px 9px; }
.tray-empty { padding: 0; white-space: nowrap; }

/* Poignée pour étirer un bloc */
.it .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.it .rz::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 3px; background: currentColor; opacity: 0; transition: opacity .15s; }
.it:hover .rz::after, .it.resizing .rz::after { opacity: .45; }
.it.resizing { z-index: 30; box-shadow: 0 0 0 2.5px var(--sel), 0 14px 26px -10px rgba(60, 40, 160, .6); transition: none; }
.rz-tip { position: absolute; right: 4px; bottom: 6px; background: var(--sel); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }

@media (max-width: 1220px) and (min-width: 761px) {
  .top-row { flex-wrap: wrap; }
  .quick { order: 3; flex-basis: 100%; }
}

/* ===== Téléphone : titre en haut, saisie en bas de l'écran ===== */
@media (max-width: 760px) {
  .top { padding: calc(6px + var(--safe-t)) 12px 8px; }
  .top-row { flex-wrap: wrap; gap: 8px; }
  .date-block { flex: 1; min-width: 0; }
  .big-date { font-size: 19px; }
  .date-block .sub { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
  .top-tools { width: 100%; gap: 6px; }
  .top-tools .seg { flex: 1; } .top-tools .seg button { flex: 1; padding: 7px 4px; font-size: 12.5px; }
  .top-tools .nav { display: none; }
  .tfilter .lg { padding: 5px 7px; }
  .tfilter .lg.all { display: none; }
  .quick {
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 46; order: 0;
  }
  .quick input { height: 50px; border-radius: 25px; font-size: 16px; box-shadow: 0 14px 34px -12px rgba(60, 40, 160, .55); }
  .quick::before { height: 54px; border-radius: 27px; }
  .quick .plus { top: 8px; left: 8px; width: 34px; height: 34px; }
  .quick .mic { top: 8px; right: 8px; width: 34px; height: 34px; }
  .preview { top: auto; bottom: calc(100% + 8px); }
  .fab { display: none !important; }
  main { padding-bottom: calc(140px + var(--safe-b)); }
  .selbar { bottom: calc(72px + var(--safe-b)); }
  #toast { bottom: calc(132px + var(--safe-b)); }
}

/* —— « Non terminé, définir nouvelle date » —— */
.tray { flex-wrap: nowrap; }
.tray .tray-title { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 13px; color: var(--coral); padding: 2px 0; flex: none; }
.tray-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--coral); color: #fff; font-family: var(--sans); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.tray-cta { font-family: var(--sans); font-size: 12px; font-weight: 800; color: var(--coral); background: rgba(255, 107, 91, .14); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tray-msg { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray.alert { background: linear-gradient(90deg, rgba(255, 107, 91, .18), rgba(255, 173, 59, .1) 60%, transparent); box-shadow: inset 4px 0 0 var(--coral); }
.tray.alert:not(.open) .tray-count { animation: beat-c 2s ease-in-out infinite; }
@keyframes beat-c { 50% { box-shadow: 0 0 0 6px rgba(255, 107, 91, .18); } }
.tray:not(.alert) .tray-title { color: var(--mint); }
.caser-alert {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer; padding: 14px 16px; border-radius: var(--r);
  background: linear-gradient(120deg, rgba(255, 107, 91, .18), rgba(255, 173, 59, .12)); box-shadow: inset 0 0 0 1.5px rgba(255, 107, 91, .45); color: var(--ink);
}
.caser-alert .ca-ico { font-size: 22px; }
.caser-alert .ca-txt { flex: 1; display: flex; flex-direction: column; }
.caser-alert b { font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--coral); }
.caser-alert small { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.section.caser .list.cards { margin-top: 10px; }

/* Fiche : section de réglages repliée */
details.more { margin: 6px 0 12px; border: 1.5px solid var(--line-2); border-radius: 16px; padding: 0 14px; background: var(--bg); }
details.more > summary { cursor: pointer; list-style: none; padding: 12px 0; font-weight: 800; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '▸'; color: var(--sel); transition: transform .2s; }
details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary span { font-weight: 600; font-size: 12.5px; color: var(--ink-3); }
details.more[open] { padding-bottom: 6px; }

/* Titre du bandeau sur une seule ligne */
.tray .tray-title { flex-direction: row; white-space: nowrap; }
/* Bords pour changer de semaine pendant un glisser */
.edge-nav { position: fixed; z-index: 990; width: 46px; pointer-events: none; display: flex; align-items: center; justify-content: center; border-radius: 18px; background: rgba(109, 93, 252, .08); transition: background .15s, width .15s; }
.edge-nav span { writing-mode: vertical-rl; font-size: 12px; font-weight: 800; color: var(--sel); letter-spacing: .04em; white-space: nowrap; }
.edge-nav.prev span { transform: rotate(180deg); }
.edge-nav.hot { background: var(--brand); }
.edge-nav.hot span { color: #fff; }
/* iPhone : le flou de l'en-tête retenait la barre de saisie (un élément « fixed » dans un parent flouté reste dans ce parent). */
@media (max-width: 760px) {
  .top { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 96%, transparent); }
}
@media (max-width: 760px) {
  .top { position: sticky; }
  #settingsBtn { position: absolute; top: calc(8px + var(--safe-t)); right: 12px; width: 34px; height: 34px; }
  .date-block { padding-right: 44px; }
  .top-tools .who-btn { padding: 3px 6px; }
}

/* —— Création : étape 1 (type) puis étape 2 —— */
.create-ctx { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; text-transform: capitalize; }
.create-step1 h2 { margin: 0 0 14px; }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 16px 14px; border-radius: 20px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: var(--bg); transition: transform .15s cubic-bezier(.2, 1.5, .4, 1), box-shadow .15s;
}
.type-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.type-card:active { transform: scale(.96); }
.type-card .tc-ic { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.type-card b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.type-card small { font-size: 12px; color: var(--ink-2); font-weight: 600; line-height: 1.35; }
.type-card.event { background: var(--pro); color: #fff; border-color: transparent; }
.type-card.event small { color: rgba(255, 255, 255, .85); }
.type-card.list { background: linear-gradient(135deg, #dff8ee, #d6f3fb); color: #0b5d45; border-color: rgba(18, 196, 139, .45); }
.type-card.list small { color: #2d7a62; }
.create-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.back-btn { width: 32px; height: 32px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--bg); font-size: 18px; font-weight: 700; display: grid; place-items: center; }
.kind-badge { padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--card-solid); border: 1.5px solid var(--line-2); }
.kind-badge.event { background: var(--pro); color: #fff; border-color: transparent; }
.kind-badge.list { background: linear-gradient(135deg, #dff8ee, #d6f3fb); color: #0b5d45; border-color: rgba(18, 196, 139, .45); }
.create-list-box { margin: -4px 0 14px; }
.create-add { width: 100%; border: 1.5px dashed rgba(18, 196, 139, .6); background: rgba(18, 196, 139, .06); border-radius: 14px; padding: 11px 13px; font-size: 15px; outline: none; margin-top: 6px; }
.create-add:focus { border-style: solid; border-color: #12c48b; }
.create-time-hint { font-size: 12px; }
@media (max-width: 760px) {
  .type-cards { grid-template-columns: 1fr; }
  .type-card { flex-direction: row; align-items: center; gap: 12px; padding: 14px; }
  .type-card .tc-ic { margin: 0; }
  .type-card b { min-width: 110px; }
}

[hidden] { display: none !important; }

/* Changer de semaine : pas de « page précédente » de Chrome sur le geste du trackpad, petite animation */
html, body { overscroll-behavior-x: none; }
.week.slide-next, #main.slide-next { animation: slideNext .28s cubic-bezier(.2, .9, .3, 1); }
.week.slide-prev, #main.slide-prev { animation: slidePrev .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes slideNext { from { opacity: .3; transform: translateX(40px); } }
@keyframes slidePrev { from { opacity: .3; transform: translateX(-40px); } }

/* Une couleur par tuile dans le choix du type */
.type-card.task { background: linear-gradient(135deg, #ffb547, #ff7a59); color: #fff; border-color: transparent; }
.type-card.task small { color: rgba(255, 255, 255, .9); }
.type-card.event { box-shadow: 0 12px 26px -14px rgba(109, 93, 252, .9); }
.type-card.task { box-shadow: 0 12px 26px -14px rgba(255, 122, 89, .9); }
.type-card.list { box-shadow: 0 12px 26px -14px rgba(18, 196, 139, .8); }
.kind-badge.task { background: linear-gradient(135deg, #ffb547, #ff7a59); color: #fff; border-color: transparent; }

/* —— Bande de 3 semaines (glissement façon Calendrier d'Apple) —— */
.week-head, .week-body { grid-template-columns: 56px minmax(0, 1fr); }
.week-head { display: grid; }
.week-body { display: grid; }
.slider { position: relative; overflow: hidden; min-width: 0; }
.week-body .slider { height: calc(var(--hour) * 24); }
.strip { position: relative; display: flex; width: 300%; transform: translateX(calc(-100% / 3)); will-change: transform; }
.week-body .strip { height: 100%; }
.pane { flex: none; width: calc(100% / 3); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week-body .pane { height: 100%; }
.week-body .col { height: 100%; }

/* —— Wolt : badge aux couleurs de Wolt —— */
.wolt-logo { display: inline-flex; align-items: center; justify-content: center; background: #009de0; color: #fff; font-family: 'Arial Rounded MT Bold', 'Nunito', var(--sans); font-weight: 900; font-size: 13px; letter-spacing: -.02em; text-transform: lowercase; padding: 2px 8px 3px; border-radius: 8px; line-height: 1.1; }
.wolt-logo.big { font-size: 18px; padding: 3px 10px 4px; border-radius: 10px; margin-right: 4px; vertical-align: 2px; }
.wolt-btn { background: #fff; color: #00243a; border: 2px solid #009de0; box-shadow: 0 8px 18px -10px rgba(0, 157, 224, .9); gap: 8px; padding: 6px 14px 6px 6px; }
.wolt-btn .wolt-logo { font-size: 12.5px; }
:root[data-theme="dark"] .wolt-btn { background: #0b2235; color: #e8f7ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wolt-btn { background: #0b2235; color: #e8f7ff; } }
.editor-wolt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 12px; }
.editor-wolt .wolt-btn { font-size: 14px; }

/* —— Fenêtre Wolt : envoyé / pas envoyé, sans texte barré —— */
.wl { display: flex; flex-direction: column; gap: 6px; }
.wl-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1.5px solid var(--line-2); background: var(--bg); border-radius: 14px; padding: 10px 12px; font-size: 15px; font-weight: 600; color: var(--ink); opacity: .55; transition: all .15s; }
.wl-item.in { opacity: 1; border-color: #009de0; background: rgba(0, 157, 224, .08); }
.wl-box { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2.5px solid var(--line-2); display: grid; place-items: center; }
.wl-item.in .wl-box { background: #009de0; border-color: #009de0; }
.wl-item.in .wl-box::after { content: '✓'; color: #fff; font-weight: 900; font-size: 13px; }
.wl-t { flex: 1; }
.wl-state { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.wl-item.in .wl-state { color: #009de0; }
.btn.primary.wolt-send { background: #009de0; box-shadow: 0 10px 22px -10px rgba(0, 157, 224, .9); }

/* —— Blocs lisibles : le texte occupe toute la hauteur disponible —— */
.it .lbl { -webkit-line-clamp: var(--lines, 2) !important; }
.it.event .lbl { -webkit-line-clamp: var(--lines, 3) !important; }
.it { font-size: 12.5px; }
.tray .chipit { max-width: 300px; }
.tray .chipit .lbl { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; }
/* Cascade façon Apple : les blocs qui se chevauchent sont décalés, pas rétrécis */
.it { box-shadow: 0 0 0 1.5px var(--card-solid), 0 3px 10px -5px rgba(60, 40, 160, .35); }
.it:hover, .it.selected { z-index: 40 !important; }

/* —— Chevauchements —— */
.week-head .clash { margin-left: auto; border: 0; cursor: pointer; font-size: 11px; font-weight: 800; color: #fff; background: var(--coral); padding: 3px 9px; border-radius: 999px; white-space: nowrap; animation: beat-c 2s ease-in-out infinite; }
.it.clashing { outline: 2px dashed var(--coral); outline-offset: -2px; }
.unclash { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.uc-row { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.uc-t { flex: 1; font-weight: 600; }
.uc-h { color: var(--ink-3); white-space: nowrap; } .uc-h b { color: var(--sel); }
