@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/roboto-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-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/roboto-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;
}

:root {
  --bg: #f5f2ea;
  --surface: #fffdf8;
  --ink: #1d1c19;
  --muted: #6a665d;
  --line: #e2dccd;
  --accent: #0f5c4d;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe5;
  --selected: #47796a;
  --selected-ink: #ffffff;
  --late: #b03a22;
  --high: #b03a22;
  --low: #7c8a94;
  --shadow: 0 1px 2px rgba(40, 35, 20, .06), 0 8px 24px rgba(40, 35, 20, .06);
  --radius: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #131512;
  --surface: #1c1f1b;
  --ink: #ecebe4;
  --muted: #a09d92;
  --line: #2e322c;
  --accent: #58c2a8;
  --accent-ink: #0b1f1a;
  --accent-soft: #1f3a33;
  --selected: #2f5a4e;
  --selected-ink: #ecebe4;
  --late: #f08c70;
  --high: #f08c70;
  --low: #8d9aa3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131512;
    --surface: #1c1f1b;
    --ink: #ecebe4;
    --muted: #a09d92;
    --line: #2e322c;
    --accent: #58c2a8;
    --accent-ink: #0b1f1a;
    --accent-soft: #1f3a33;
    --selected: #2f5a4e;
    --selected-ink: #ecebe4;
    --late: #f08c70;
    --high: #f08c70;
    --low: #8d9aa3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- structure ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
main {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}

.nav {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-weight: 800;
  letter-spacing: .14em;
  font-size: 15px;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3.5px;
  width: 6px;
  height: 11px;
  border: solid var(--accent-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg);
}
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-items button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  text-align: left;
  font-weight: 500;
}
.nav-items button:hover { background: var(--accent-soft); color: var(--ink); }
.nav-items button.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav-items svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-items span { flex: 1; }
.count {
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.count:empty { display: none; }
.install {
  margin-top: auto;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- en-tête ---------- */
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.02em; font-weight: 750; }
.sub { margin: 4px 0 0; color: var(--muted); }
.sub::first-letter { text-transform: uppercase; }

.top-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
.pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill[data-status="synced"] .dot { background: var(--accent); }
.pill[data-status="syncing"] .dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.pill[data-status="offline"] .dot { background: #c98a1b; }
.pill[data-status="error"] .dot, .pill[data-status="auth"] .dot { background: var(--late); }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- progression ---------- */
.progress { margin-bottom: 18px; }
.progress-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .35s ease; }

/* ---------- formulaires ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- champ date et calendrier ---------- */
.date { position: relative; min-width: 0; }
.date-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
}
.date-btn svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.date-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-btn.empty span { color: var(--muted); }
.date-btn[aria-expanded="true"] { border-color: var(--accent); }
.date-btn[aria-expanded="true"] svg { stroke: var(--accent); }
.date-pop {
  position: fixed;
  z-index: 30;
  width: 290px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.cal-month { font-size: 15px; font-weight: 650; }
.cal-month::first-letter { text-transform: uppercase; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 3px; }
.cal-week span { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-week abbr { text-decoration: none; }
.cal-grid [role="row"] { display: grid; grid-template-columns: repeat(7, 1fr); }
.day {
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.day.out { color: var(--muted); opacity: .5; }
.day:hover { background: var(--accent-soft); }
.day.today { font-weight: 700; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day.selected { background: var(--selected); color: var(--selected-ink); font-weight: 600; box-shadow: none; }
.day.selected:hover { filter: brightness(1.08); }
.cal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--line); }

/* ---------- listes déroulantes ---------- */
.select { position: relative; min-width: 0; }
.select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  text-align: left;
}
.select-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-btn::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.select-btn[aria-expanded="true"] { border-color: var(--accent); }
.select-btn[aria-expanded="true"]::after { margin-top: 4px; transform: rotate(-135deg); }
.select-list {
  position: fixed;
  z-index: 30;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
}
.select-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 12px;
  border-radius: 7px;
  white-space: nowrap;
  cursor: pointer;
}
.select-list li + li { margin-top: 2px; }
.select-list li.active { background: var(--accent-soft); }
.select-list li[aria-selected="true"] { background: var(--selected); color: var(--selected-ink); font-weight: 500; }
.select-list li[aria-selected="true"].active { filter: brightness(1.08); }
.select-list li[aria-selected="true"]::after {
  content: "";
  flex: none;
  width: 5px;
  height: 10px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 14px;
  padding-left: 14px;
  font-size: 15px;
  box-shadow: var(--shadow);
}
.add-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
@media (max-width: 720px) { .add-btn { width: 100%; justify-content: center; } }
.add-opts .date-btn, .add-opts .select-btn { min-height: 40px; background: var(--bg); font-size: 14px; }
.search { margin-bottom: 14px; background: transparent; }

.btn {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--late); }
.btn.link { border: 0; background: none; padding-inline: 0; color: var(--muted); font-weight: 500; text-decoration: underline; }

/* ---------- listes ---------- */
.group { margin-bottom: 22px; }
.group h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.group h2.late { color: var(--late); }
.group h2 .n { font-weight: 500; letter-spacing: 0; }
.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.task { display: flex; align-items: stretch; border-left: 3px solid transparent; }
.task + .task { border-top: 1px solid var(--line); }
.task.p3 { border-left-color: var(--high); }
.check {
  flex: none;
  width: 52px;
  min-height: 52px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
}
.check span {
  width: 22px;
  height: 22px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s;
}
.check:hover span { border-color: var(--accent); }
.check[aria-checked="true"] span { background: var(--accent); border-color: var(--accent); }
.check[aria-checked="true"] span::after {
  content: "";
  width: 5px;
  height: 10px;
  margin-top: -2px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.body {
  flex: 1;
  min-width: 0;
  padding: 11px 14px 11px 0;
  border: 0;
  background: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.title { overflow-wrap: anywhere; }
.task.done .title { color: var(--muted); text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.meta .late { color: var(--late); font-weight: 600; }
.meta .prio.p3 { color: var(--high); font-weight: 600; }
.meta .prio.p1 { color: var(--low); }
.meta .note { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* le responsable : une pastille, pour le repérer d'un coup d'œil dans la liste */
.meta .owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, var(--ink));
  font-weight: 600;
}
.meta .owner::before {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M4.8 20c0-3.7 3.2-5.6 7.2-5.6s7.2 1.9 7.2 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='3.6'/%3E%3Cpath d='M4.8 20c0-3.7 3.2-5.6 7.2-5.6s7.2 1.9 7.2 5.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty-title { margin: 0 0 4px; color: var(--ink); font-size: 18px; font-weight: 650; }
.empty p { margin: 0; }

/* ---------- filtres des tâches terminées ---------- */
.done-bar {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.done-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg); }
.seg button {
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--selected); color: var(--selected-ink); }
.exports { display: flex; gap: 8px; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.period-nav { display: flex; align-items: center; gap: 4px; }
.step {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}
.step:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.step:disabled { opacity: .35; cursor: default; }
.period-label { font-weight: 600; font-variant-numeric: tabular-nums; }
.period-label::first-letter { text-transform: uppercase; }
.period-count { color: var(--muted); font-size: 14px; }

/* ---------- suivi ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.tile, .card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; }
.tile-value { font-size: 28px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-value.late { color: var(--late); }
.tile-label { margin-top: 4px; font-size: 13px; color: var(--muted); }
.card h2 { margin: 0 0 14px; font-size: 15px; }
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 190px; }
.chart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart-n { height: 18px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-track { flex: 1; width: 100%; max-width: 44px; display: flex; align-items: flex-end; border-radius: 6px; background: var(--bg); }
.chart-bar { width: 100%; min-height: 2px; border-radius: 6px; background: var(--accent); opacity: .45; }
.chart-bar.is-today { opacity: 1; }
.chart-day { font-size: 12px; color: var(--muted); }

/* ---------- écran d'attente au lancement ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.boot .brand-mark { width: 40px; height: 40px; border-radius: 12px; animation: boot 1.2s ease-in-out infinite; }
.boot .brand-mark::after { left: 13px; top: 7px; width: 10px; height: 19px; border-width: 0 4px 4px 0; }
@keyframes boot { 50% { opacity: .35; } }

.btn.solid-danger { border-color: var(--late); background: var(--late); color: #fff; }
.btn.solid-danger:hover { filter: brightness(1.06); }
#confirmDialog h2 { margin-bottom: 10px; }
#confirmDialog .hint { margin-bottom: 0; }

/* ---------- écran de connexion ---------- */
.auth {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
  overflow-y: auto;
}
.auth-card {
  width: min(380px, 100%);
  text-align: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 800;
  letter-spacing: .14em;
  font-size: 14px;
}
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; }
.auth-card label input { margin-top: 5px; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--bg); text-align: left; }
.auth-card .error { margin: 0 0 12px; }
.btn.wide { width: 100%; justify-content: center; }
.hint.small { margin: 14px 0 0; font-size: 13px; text-align: center; }

/* ---------- paramètres ---------- */
.setting { margin-bottom: 14px; }
.setting h2 { margin: 0 0 10px; font-size: 15px; }
.setting .actions { margin-top: 14px; }
.users { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.user { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; flex-wrap: wrap; }
.user + .user { border-top: 1px solid var(--line); }
.user.is-blocked { background: color-mix(in srgb, var(--late) 7%, transparent); }
.user-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-mail { display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.user-meta { font-size: 13px; color: var(--muted); }
.user-meta .late { color: var(--late); font-weight: 600; }
.user-actions { display: flex; gap: 8px; }
.tag {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.icon-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* les cases à cocher suivent le vert de l'application, pas le bleu du système */
input[type="checkbox"] { accent-color: var(--accent); }
.check-line { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); }
.check-line input { width: auto; min-height: 0; }
.field-row { display: flex; gap: 8px; margin-top: 5px; }
.field-row input { flex: 1; min-width: 0; }

/* ---------- fenêtres ---------- */
dialog {
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
dialog::backdrop { background: rgba(20, 18, 12, .45); }
dialog h2 { margin: 0 0 16px; font-size: 20px; }
dialog label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
dialog label .select, dialog label .date { margin-top: 5px; }
dialog label .date-btn, dialog label .select-btn { font-size: 16px; font-weight: 400; color: var(--ink); background: var(--bg); }
dialog label input, dialog label textarea { margin-top: 5px; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--bg); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.actions.foot { padding-top: 14px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.hint { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.hint strong { color: var(--ink); }
.error { margin: 0; color: var(--late); font-size: 14px; font-weight: 600; }

.block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.block h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.code {
  margin: 6px 0 8px;
  padding: 14px 10px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: all;
}
#aCodeInput { font-size: 20px; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.detach { margin: 12px 0 0; text-align: center; }
.detach .btn { font-size: 13px; }
.btn.link.danger { color: var(--late); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 24px);
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .app { display: block; }
  main { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; }
  .nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    height: auto;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }
  .brand, .install { display: none; }
  .nav-items { flex-direction: row; }
  .nav-items button {
    position: relative;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 7px 2px;
    font-size: 11px;
    text-align: center;
  }
  .nav-items button:hover { background: none; }
  .nav-items button.active { background: var(--accent-soft); }
  .nav-items span { flex: none; }
  .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; font-size: 11px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.block h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.code {
  margin: 6px 0 8px;
  padding: 14px 10px;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: all;
}
#aCodeInput { font-size: 20px; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.detach { margin: 12px 0 0; text-align: center; }
.detach .btn { font-size: 13px; }
.btn.link.danger { color: var(--late); }

.toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .chart { gap: 6px; }
}
@media (max-width: 460px) {
  .done-row { gap: 8px; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 6px 4px; }
  .exports { width: 100%; }
  .exports .btn { flex: 1; }
}
@media (max-width: 380px) {
  .add-opts { flex-wrap: wrap; }
  .add-opts .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- animations ---------- */
@keyframes surgir { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes descendre { from { opacity: 0; transform: translateY(-7px); } }
@keyframes fondu { from { opacity: 0; } }
@keyframes toast-entree { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes coche { 45% { transform: scale(1.35); } }
@keyframes eclair { from { background: color-mix(in srgb, var(--accent) 18%, transparent); } }

/* apparitions */
.auth-card { animation: surgir .34s cubic-bezier(.2, .8, .3, 1) backwards; }
.app.anim-entree { animation: fondu .32s ease backwards; }
#content.anim-vue { animation: descendre .24s cubic-bezier(.2, .8, .3, 1) backwards; }
dialog[open] { animation: fondu .2s ease backwards; }
dialog[open]::backdrop { animation: fondu .22s ease backwards; }
.toast:not([hidden]) { animation: toast-entree .28s cubic-bezier(.2, .8, .3, 1.2) backwards; }

/* une tâche qui arrive, une tâche que l'on termine */
.task.anim-entree { animation: descendre .3s cubic-bezier(.2, .8, .3, 1) backwards; }
.task.anim-fait { animation: eclair .65s ease backwards; }
.task.anim-fait .check span { animation: coche .36s cubic-bezier(.2, .8, .3, 1.4); }

/* réactions au survol et au clic */
.task { transition: background .18s ease; }
.task:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.btn, .icon-btn, .nav-items button, .pill { transition: background .15s, border-color .15s, color .15s, transform .12s ease; }
.btn:active, .icon-btn:active, .nav-items button:active, .pill:active { transform: scale(.97); }
.icon-btn svg { transition: transform .35s cubic-bezier(.2, .8, .3, 1); }
#themeBtn:hover svg { transform: rotate(20deg); }
#settingsBtn:hover svg { transform: rotate(45deg); }
.check span { transition: background .15s, border-color .15s, transform .15s ease; }
.check:hover span { transform: scale(1.12); }
