/* PYGMA STUDIO · tableau de bord en noir et blanc.
   Les couleurs de la charte Pygma ne servent que d'accent :
   bordeaux pour ce qui compte (chiffres clés, progression, bouton de capture),
   mist pour les repères (aujourd'hui, badges, minuteur).
   Typo : Apfel Grotezk, Regular et Mittel. */

@font-face { font-family: 'Apfel Grotezk'; font-weight: 400; font-display: swap; src: url(fonts/ApfelGrotezk-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Apfel Grotezk'; font-weight: 500; font-display: swap; src: url(fonts/ApfelGrotezk-Mittel.woff2) format('woff2'); }
@font-face { font-family: 'Apfel Grotezk'; font-weight: 700; font-display: swap; src: url(fonts/ApfelGrotezk-Fett.woff2) format('woff2'); }

:root {
  /* Charte Pygma (accents uniquement) */
  --bordeaux: #630A0B;
  --mist: #98CCEA;

  /* Base neutre */
  --canvas: #F6F6F4;
  --canvas-image: none;
  --panel: #FFFFFF;
  --panel-2: #F1F1EF;
  --side: #FFFFFF;
  --ink: #111111;
  --ink-soft: #6E6E6E;
  --line: rgba(0, 0, 0, .08);
  --primary-bg: var(--bordeaux);  /* tout ce qui est rempli : boutons, menu actif, onglets, étiquettes */
  --primary-ink: #FFFFFF;
  --soft-tile: #FFFFFF;
  /* Grandes surfaces : dégradé bordeaux de la charte + halo mist (comme l'emblème) */
  --strong-bg: radial-gradient(90% 120% at 100% 0%, rgba(152, 204, 234, .30) 0%, rgba(152, 204, 234, 0) 55%), radial-gradient(ellipse 75% 110% at 42% 45%, #700808 0%, #5C0707 55%, #480000 100%);
  --on-strong: #FFFFFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -14px rgba(0, 0, 0, .12);

  /* Accents */
  --accent: var(--bordeaux);      /* remplissages : barres, points, bouton capture */
  --accent-ink: #FFFFFF;
  --accent-text: var(--bordeaux); /* chiffres clés */
  --hi: var(--mist);              /* repères doux */
  --hi-ink: #111111;

  --r-card: 24px;
  --r-row: 18px;
  --r-pill: 999px;
  --font: 'Apfel Grotezk', 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --fs: 16.5px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0E0E0E;
    --panel: #171717;
    --panel-2: #222222;
    --side: #0B0B0B;
    --ink: #F2F2F2;
    --ink-soft: rgba(255, 255, 255, .58);
    --line: rgba(255, 255, 255, .09);
    --primary-bg: var(--bordeaux);
    --primary-ink: #FFFFFF;
    --soft-tile: #171717;
    --strong-bg: radial-gradient(90% 120% at 100% 0%, rgba(152, 204, 234, .30) 0%, rgba(152, 204, 234, 0) 55%), radial-gradient(ellipse 75% 110% at 42% 45%, #700808 0%, #5C0707 55%, #480000 100%);
    --shadow: none;
    --accent: var(--mist);
    --accent-ink: #111111;
    --accent-text: #F2F2F2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0E0E0E;
  --panel: #171717;
  --panel-2: #222222;
  --side: #0B0B0B;
  --ink: #F2F2F2;
  --ink-soft: rgba(255, 255, 255, .58);
  --line: rgba(255, 255, 255, .09);
  --primary-bg: var(--bordeaux);
  --primary-ink: #FFFFFF;
  --soft-tile: #171717;
  --strong-bg: radial-gradient(90% 120% at 100% 0%, rgba(152, 204, 234, .30) 0%, rgba(152, 204, 234, 0) 55%), radial-gradient(ellipse 75% 110% at 42% 45%, #700808 0%, #5C0707 55%, #480000 100%);
  --shadow: none;
  --accent: var(--mist);
  --accent-ink: #111111;
  --accent-text: #F2F2F2;
  color-scheme: dark;
}

:root.big-text { --fs: 19.5px; }

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas-image), var(--canvas);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.6vw, 2.6rem); line-height: 1.05; font-weight: 500; letter-spacing: -.035em; }
h2 { font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em; }
strong, b { font-weight: 500; }
sup { font-size: .5em; font-weight: 500; margin-left: .15em; vertical-align: super; color: var(--ink-soft); }
a { color: inherit; }
code { background: var(--panel-2); padding: .05em .35em; border-radius: 6px; font-size: .9em; }
button { font: inherit; color: inherit; }

.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.muted { color: var(--ink-soft); }
.soft { opacity: .72; }
.small { font-size: .82rem; }
.label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 500; opacity: .8; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--mist); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 99; background: var(--panel); padding: .5rem 1rem; border-radius: var(--r-pill); }

/* ================= Structure ================= */

.shell { min-height: 100dvh; }

.sidebar { display: none; }
.content { min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .75rem;
  padding: calc(.7rem + env(safe-area-inset-top)) 16px .7rem;
  background: color-mix(in srgb, var(--canvas) 90%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 500; font-size: 1.2rem; letter-spacing: -.01em; }
.brand img { border-radius: 22%; }
.mode { margin-left: auto; }
.top-actions { display: flex; align-items: center; gap: .5rem; }
.round-btn {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line); text-decoration: none;
}
.round-btn .dot { position: absolute; top: 8px; right: 9px; }
.user-chip { display: none; align-items: center; gap: .6rem; font-weight: 500; padding-left: .4rem; }

main {
  max-width: 1320px;
  padding: .5rem 16px calc(7.5rem + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 1.5rem;
  outline: none;
}

/* Barre d'onglets mobile : une pilule flottante */
.tabbar {
  position: fixed; z-index: 20;
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px; border-radius: var(--r-pill);
  background: var(--strong-bg); color: var(--on-strong);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .4);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: .45rem .1rem; border-radius: var(--r-pill);
  text-decoration: none; font-size: .66rem; font-weight: 500; opacity: .78;
}
.tabbar a .ico { width: 1.35rem; height: 1.35rem; }
.tabbar a.is-active { background: var(--hi); color: var(--hi-ink); opacity: 1; font-weight: 500; }
.tabbar .badge { position: absolute; top: 2px; left: calc(50% + .35rem); }
.tabbar .dot { position: absolute; top: 7px; left: calc(50% + .55rem); background: var(--mist); }

.fab {
  position: fixed; z-index: 20; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .4);
  display: grid; place-items: center;
}
.fab .ico { width: 1.6rem; height: 1.6rem; stroke-width: 2.2; }

.badge { min-width: 1.25rem; padding: 0 .35rem; border-radius: var(--r-pill); background: var(--hi); color: var(--hi-ink); font-size: .68rem; line-height: 1.25rem; text-align: center; font-weight: 500; }
.dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 250px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 1.5rem;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 1.4rem 1rem 1.2rem;
    background: var(--side); border-right: 1px solid var(--line);
  }
  .side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; color: var(--ink-soft); padding: 1rem .9rem .4rem; }
  .side-nav a {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem .9rem; border-radius: var(--r-pill);
    text-decoration: none; font-weight: 500;
  }
  .side-nav a:hover { background: var(--panel-2); }
  .side-nav a.is-active { background: var(--primary-bg); color: var(--primary-ink); font-weight: 500; }
  .side-nav .badge, .side-nav .dot { margin-left: auto; }
  .btn-block { width: 100%; }
  .brand-mobile, .tabbar, .fab { display: none; }
  .topbar { padding: 1.1rem 2rem; background: none; backdrop-filter: none; position: static; }
  .user-chip { display: flex; }
  main { padding: .25rem 2rem 3rem; }
}

/* ================= En-têtes ================= */

.hello { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; }
.hello-date::first-letter { text-transform: uppercase; }
.hello-date { margin-top: .4rem; }
.hello-links { display: flex; gap: 1.5rem; }
.hello-links a { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; font-size: 1.15rem; font-weight: 500; }
.hello-links .ico { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); }

.page-head { display: flex; flex-direction: column; gap: .35rem; }
.page-head-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.page-head-row > div { display: flex; flex-direction: column; gap: .35rem; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.sec-title { font-size: 1.35rem; font-weight: 500; letter-spacing: -.03em; }
.link { font-weight: 500; font-size: .9rem; text-decoration: none; border-bottom: 2px solid var(--accent); }

/* ================= Tableau de bord ================= */

.dash { display: grid; gap: 1.5rem; }
.dash-main { display: flex; flex-direction: column; gap: 1.8rem; min-width: 0; }
.dash-rail { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (min-width: 1200px) {
  .dash { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .dash-rail { position: sticky; top: 1rem; }
}

.tiles { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } .tiles .tile-hero { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .tiles { grid-template-columns: 1.5fr 1fr 1fr; } .tiles .tile-hero { grid-column: auto; } }

.tile {
  position: relative;
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.25rem; border-radius: var(--r-card);
  min-height: 170px; box-shadow: var(--shadow);
}
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.tile-foot { margin-top: auto; padding-top: .6rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tile-big { font-size: 1.65rem; font-weight: 400; line-height: 1.12; letter-spacing: -.03em; }
.tile-num { font-size: 3.6rem; font-weight: 400; line-height: .9; letter-spacing: -.06em; }
.tile-mid { font-size: 1.15rem; font-weight: 500; line-height: 1.2; }

.tile-hero { background: var(--strong-bg); color: var(--on-strong); }
.tile-mist { background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.tile-mist .tile-num { color: var(--accent-text); }
.tile-mist .chip-solid { background: var(--panel-2); }
.tile-plain { background: var(--panel); border: 1px solid var(--line); }
.tile-soft { background: var(--soft-tile); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile-hero { outline: 1px solid rgba(255, 255, 255, .18); outline-offset: -1px; } }

.go {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--panel-2); color: var(--ink); text-decoration: none;
}
.tile-hero .go { background: rgba(255, 255, 255, .16); color: var(--on-strong); }
.tile-plain .go, .tile-soft .go { background: var(--panel-2); color: var(--ink); }
.go .ico { width: 1.2rem; height: 1.2rem; }

.chip-glass, .chip-solid {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .8rem; border-radius: var(--r-pill);
  font-size: .82rem; font-weight: 500;
}
.chip-glass { background: rgba(255, 255, 255, .14); }
.chip-solid { background: rgba(255, 255, 255, .55); font-weight: 500; }

.avatars { display: flex; }
.avatars .avatar { margin-left: -8px; border: 2px solid var(--panel); }
.avatars .avatar:first-child { margin-left: 0; }
.avatar {
  flex: none; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: .78rem; font-weight: 500; letter-spacing: .02em;
}
.avatar-0 { background: var(--hi); color: var(--hi-ink); }
.avatar-1 { background: var(--primary-bg); color: var(--primary-ink); }
.avatar-2 { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* Bandeau des changements d'agenda */
.banner {
  display: grid; gap: 1rem; align-items: center;
  grid-template-columns: auto 1fr;
  padding: 1.1rem 1.25rem; border-radius: var(--r-card);
  background: var(--strong-bg); color: var(--on-strong);
  box-shadow: var(--shadow);
}
.banner-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--hi); color: var(--hi-ink); align-self: start; }
.banner-body { display: flex; flex-direction: column; gap: .35rem; }
.banner ul { margin: .2rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.banner s { opacity: .6; }
.banner .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 760px) { .banner { grid-template-columns: auto 1fr auto; } .banner .btn { grid-column: auto; } }

/* Priorités (cartes façon « line-up ») */
.prio-grid, .event-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .prio-grid, .event-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prio-card, .event-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1rem;
  padding: 1.1rem; border-radius: var(--r-card); min-height: 150px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.prio-card.is-first { box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.prio-card.is-first .prio-num { color: var(--accent-text); }
.prio-card.is-empty {
  align-items: center; justify-content: center; gap: .6rem; cursor: pointer;
  background: none; border: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); box-shadow: none;
  font-weight: 500; color: var(--ink-soft);
}
.prio-card.is-empty:hover { background: var(--panel); color: var(--ink); }
.plus-circle { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid currentColor; }
.prio-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.prio-title { font-weight: 500; line-height: 1.25; margin-top: .2rem; overflow-wrap: anywhere; }
.prio-num, .event-time { font-size: 2.1rem; font-weight: 400; line-height: .9; letter-spacing: -.05em; }
.prio-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .8rem; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel);
  font-size: .82rem; font-weight: 500;
}
.pill-btn.pill-strong { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; }

.event-card.is-now { background: var(--strong-bg); color: var(--on-strong); border-color: transparent; }
.event-card.is-now .row-meta { color: var(--on-strong); opacity: .7; }
.event-card.is-now .pill { background: rgba(255, 255, 255, .14); color: var(--on-strong); }
.event-card.is-now .pill-strong { background: var(--hi); color: var(--hi-ink); }
.event-card.is-past { opacity: .55; }

/* Onglets en pilule */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); margin-bottom: .9rem; max-width: 100%; align-self: flex-start; }
.seg-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 0; background: none; cursor: pointer;
  padding: .5rem .95rem; border-radius: var(--r-pill);
  font-weight: 500; font-size: .92rem; color: var(--ink-soft);
}
.seg-btn b { min-width: 1.4rem; padding: 0 .35rem; border-radius: var(--r-pill); background: var(--panel-2); color: var(--ink); font-size: .74rem; line-height: 1.4rem; text-align: center; }
.seg-btn.is-on { background: var(--primary-bg); color: var(--primary-ink); font-weight: 500; }
.seg-btn.is-on b { background: var(--hi); color: var(--hi-ink); }

/* Lignes de tâches (façon « my work ») */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.row-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem;
  padding: .7rem .7rem .7rem .85rem; border-radius: var(--r-row);
  background: var(--panel); border: 1px solid var(--line);
}
.row-item.is-prio { box-shadow: inset 4px 0 0 var(--accent); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-meta { font-size: .76rem; color: var(--ink-soft); }
.row-meta.is-late { color: var(--ink); font-weight: 500; }
.row-title { font-weight: 400; font-size: 1.02rem; overflow-wrap: anywhere; }
.row-date { display: none; font-size: .85rem; color: var(--ink-soft); white-space: nowrap; }
.row-actions { display: flex; }
@media (min-width: 640px) { .row-item { grid-template-columns: auto minmax(0, 1fr) auto auto; } .row-date { display: block; } }

.check {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid color-mix(in srgb, var(--ink) 40%, transparent); background: none; color: transparent;
}
.check .ico { width: 1rem; height: 1rem; stroke-width: 2.6; }
.check:hover { background: var(--hi); border-color: var(--mist); color: var(--hi-ink); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: none; color: var(--ink-soft); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.icon-btn.is-on { color: var(--ink); }
.icon-btn.is-on .ico { fill: var(--mist); stroke: var(--ink); }

.quick-add {
  display: flex; align-items: center; gap: .5rem; margin-top: .55rem;
  padding: .35rem .35rem .35rem .9rem; border-radius: var(--r-pill);
  border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent);
}
.quick-add input { border: 0; background: none; min-height: 40px; padding: 0; }
.quick-add input:focus { outline: none; }
.quick-add:focus-within { border-style: solid; border-color: var(--ink); background: var(--panel); }
.quick-plus { color: var(--ink-soft); display: grid; }

.hint { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; font-size: .9rem; color: var(--ink-soft); margin-bottom: .6rem; }
.empty { color: var(--ink-soft); padding: 1.4rem 1rem; text-align: center; border-radius: var(--r-row); border: 1.5px dashed var(--line); }
.notice { display: flex; gap: .5rem; align-items: flex-start; background: var(--panel-2); color: var(--ink); border-left: 3px solid var(--accent); padding: .8rem 1rem; border-radius: var(--r-row); }
.notice[hidden] { display: none; }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: var(--r-pill); background: var(--panel-2); font-size: .78rem; font-weight: 500; white-space: nowrap; }
.pill-strong { background: var(--primary-bg); color: var(--primary-ink); }
.pill-mist { background: var(--hi); color: var(--hi-ink); }

/* Rappels + anneau de progression */
.ring-head { display: flex; align-items: center; gap: .9rem; }
.ring { width: 76px; height: 76px; flex: none; }
.ring line { stroke: color-mix(in srgb, var(--ink) 20%, transparent); stroke-width: 3; stroke-linecap: round; }
.ring line.on { stroke: var(--ink); }
.ring text { fill: var(--ink); font-family: var(--font); font-weight: 500; font-size: 17px; }
.routine-list { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.routine {
  display: flex; flex-direction: row; align-items: center; gap: .7rem; cursor: pointer; font-weight: 500;
  padding: .6rem .75rem; border-radius: var(--r-row); background: var(--panel-2);
}
.routine-time { font-weight: 500; font-variant-numeric: tabular-nums; min-width: 3rem; }
.routine.is-due { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.routine.is-done { opacity: .55; text-decoration: line-through; }

/* Frise de la semaine */
.week { min-height: 0; }
.week-nav { display: flex; align-items: center; gap: .1rem; font-size: .85rem; font-weight: 500; padding: 2px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.wk-grid { position: relative; display: grid; grid-template-columns: 28px repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: .4rem; }
.wk-hours { position: relative; grid-row: 1; margin-top: 58px; height: 260px; }
.wk-hours span { position: absolute; left: 0; transform: translateY(-50%); font-size: .62rem; color: var(--ink-soft); }
.wk-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wk-day { display: flex; flex-direction: column; align-items: center; height: 50px; justify-content: center; border-radius: var(--r-pill); font-size: .7rem; color: var(--ink-soft); position: relative; }
.wk-day b { font-size: 1.05rem; color: var(--ink); }
.wk-col.is-today .wk-day { background: var(--hi); color: var(--hi-ink); }
.wk-col.is-today .wk-day b { color: var(--hi-ink); }
.wk-dot { position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.wk-body {
  position: relative; height: 260px; border-radius: 10px;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%);
}
.wk-col.is-weekend .wk-body { background-color: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.block {
  position: absolute; left: 2px; right: 2px; border-radius: 7px; overflow: hidden;
  font-size: .68rem; line-height: 1.15; padding: 3px 4px; font-weight: 500;
}
.block small { display: block; font-weight: 500; opacity: .8; }
.b-1 { background: var(--primary-bg); color: var(--primary-ink); }
.b-2 { background: var(--mist); color: #111111; }
.b-3 { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.b-hatch { background: repeating-linear-gradient(135deg, var(--accent) 0 5px, color-mix(in srgb, var(--accent) 70%, var(--panel)) 5px 10px); color: var(--accent-ink); }
.block.is-past { opacity: .45; }
.now-line { position: absolute; left: -3px; right: -3px; height: 2px; background: var(--ink); border-radius: 2px; }
.now-line::before { content: ''; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.week-foot { display: flex; justify-content: space-between; align-items: baseline; padding-top: .8rem; margin-top: .4rem; border-top: 1px solid var(--line); }
.week-big .wk-body, .week-big .wk-hours { height: 420px; }

/* Agenda : jour par jour */
.day-row { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; padding: .7rem .9rem; border-radius: var(--r-row); background: var(--panel); border: 1px solid var(--line); }
.day-row.is-empty { background: none; }
.day-row.is-today { border-color: var(--mist); box-shadow: inset 4px 0 0 var(--mist); }
.day-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; background: var(--panel-2); font-size: .68rem; color: var(--ink-soft); flex: none; }
.day-badge b { font-size: 1.1rem; color: var(--ink); line-height: 1; }
.day-row.is-today .day-badge { background: var(--hi); color: var(--hi-ink); }
.day-row.is-today .day-badge b { color: var(--hi-ink); }
.day-items { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; min-width: 0; }
.ev-chip { padding: .35rem .75rem; border-radius: var(--r-pill); background: var(--panel-2); font-size: .88rem; overflow-wrap: anywhere; }
.ev-chip.is-past { opacity: .5; }

/* ================= Emails ================= */

.mail-layout { display: grid; gap: 1rem; }
.mail-panel { padding: .5rem; }
.mail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-row {
  width: 100%; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center;
  padding: .7rem .8rem; border: 0; border-radius: var(--r-row); background: none;
}
.mail-row:hover { background: var(--panel-2); }
.mail-row.is-on { background: var(--primary-bg); color: var(--primary-ink); }
.mail-main { display: flex; flex-direction: column; min-width: 0; }
.mail-subj { font-size: .88rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-side { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.mail-inline { padding: .6rem .8rem 1rem 3.6rem; display: flex; flex-direction: column; gap: .7rem; color: var(--ink-soft); }
.mail-detail { display: none; }
@media (min-width: 1000px) {
  .mail-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
  .mail-inline { display: none; }
  .mail-detail {
    position: sticky; top: 1rem;
    display: flex; flex-direction: column; gap: 1rem;
    padding: 1.4rem; border-radius: var(--r-card);
    background: var(--strong-bg); color: var(--on-strong);
  }
  .mail-detail .btn-primary { background: var(--hi); color: var(--hi-ink); }
  .mail-detail .btn-soft { background: rgba(255, 255, 255, .12); color: var(--on-strong); }
  .mail-detail .pill { background: rgba(255, 255, 255, .14); }
}
.detail-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.detail-head .chip-glass { margin-left: auto; }
.detail-head .avatar { width: 46px; height: 46px; }
.detail-subject { font-size: 1.6rem; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; }
.glass-box { display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.1rem; border-radius: var(--r-row); background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); }

/* ================= URSSAF ================= */

.hero {
  display: flex; flex-direction: column; gap: 1.3rem;
  padding: 1.4rem; border-radius: var(--r-card);
  background: var(--strong-bg); color: var(--on-strong); box-shadow: var(--shadow);
}
.hero-stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hero-num { font-size: 3.4rem; font-weight: 400; line-height: .95; letter-spacing: -.05em; margin-top: .3rem; }
.hero-num-s { font-size: 2.2rem; }
.mbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.mbar { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.mbar i { display: block; width: 100%; height: 10px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); }
.mbar small { font-size: .62rem; opacity: .7; }
.mbar-done i { background: var(--hi); }
.mbar-current i { background: var(--on-strong); outline: 2px solid var(--mist); outline-offset: 2px; }
.steps { margin: .3rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.steps label { display: flex; flex-direction: row; align-items: flex-start; gap: .65rem; cursor: pointer; font-weight: 400; font-size: 1rem; }
.steps input { margin-top: .2rem; accent-color: var(--mist); }
.steps label:has(input:checked) span { opacity: .55; text-decoration: line-through; }
.two-col { display: grid; gap: 1rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; } }
.deadline-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.deadline-list li { display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center; }
.deadline-list .day-badge { width: 48px; height: 48px; }
.deadline-list .is-done { opacity: .5; }

/* ================= Formulaires ================= */

.panel { display: flex; flex-direction: column; gap: .9rem; padding: 1.25rem; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel .sec-head { margin-bottom: 0; }
.panel .sec-title { font-size: 1.2rem; }

.btn {
  transition: background-color .15s, border-color .15s, filter .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 46px; padding: .6rem 1.2rem; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font-weight: 500; font-size: .95rem;
}
.btn-small { min-height: 38px; padding: .4rem .9rem; font-size: .86rem; }
.btn-primary { background: var(--primary-bg); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-soft { background: var(--panel-2); }
.btn-soft:hover { border-color: var(--line); }
.btn-ghost { background: none; border-color: var(--line); }
.btn-light { background: #FFFFFF; color: var(--bordeaux); }
.btn-glass { background: rgba(255, 255, 255, .12); color: var(--on-strong); }
.btn:disabled { opacity: .6; cursor: progress; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

input, select {
  font: inherit; color: var(--ink); width: 100%;
  background: var(--panel-2); border: 1px solid transparent;
  border-radius: 14px; padding: .65rem .9rem; min-height: 48px;
}
input::placeholder { color: var(--ink-soft); opacity: .8; }
input:focus { outline: 3px solid color-mix(in srgb, var(--mist) 70%, transparent); border-color: var(--ink); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--ink); }
input[type=checkbox] { width: 1.25rem; height: 1.25rem; flex: none; }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .92rem; }
.field input { font-weight: 400; }
.check-line { flex-direction: row; align-items: center; gap: .6rem; font-weight: 500; }
.add-task-full { display: flex; flex-direction: column; gap: .9rem; }
.add-task-full > .btn { align-self: flex-start; }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.chips legend { font-weight: 500; font-size: .92rem; margin-bottom: .45rem; padding: 0; }
.chip { position: relative; font-weight: 500; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: .5rem 1rem; border-radius: var(--r-pill); background: var(--panel-2); cursor: pointer; border: 1px solid transparent; }
.chip input:checked + span { background: var(--primary-bg); color: var(--primary-ink); font-weight: 500; }
.chip input:focus-visible + span { outline: 3px solid var(--mist); outline-offset: 2px; }
.form-grid { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; align-items: end; }
.form-grid input { font-weight: 400; }
.span-2 { grid-column: 1 / -1; }

.routine-edit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.routine-edit li { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: .5rem; align-items: center; padding: .8rem; border-radius: var(--r-row); background: var(--panel-2); }
.routine-edit input { background: var(--panel); }
.routine-edit [data-field=label] { grid-row: 1; grid-column: 1 / 3; }
.routine-edit .icon-btn { grid-row: 1; grid-column: 3; }
.routine-edit [data-field=time] { grid-row: 2; grid-column: 1; }
.routine-edit .days { grid-row: 2; grid-column: 2 / 4; display: flex; gap: .3rem; flex-wrap: wrap; }
@media (max-width: 480px) { .routine-edit .days { grid-row: 3; grid-column: 1 / -1; } }
.day-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: .85rem; font-weight: 500; cursor: pointer; }
.day-btn.is-on { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; }

.banner-btn { display: inline-flex; align-items: center; gap: .35rem; border: 0; cursor: pointer; padding: .4rem .9rem; border-radius: var(--r-pill); background: var(--hi); color: var(--hi-ink); font-weight: 500; font-size: .85rem; }

/* ================= Toast & dialogues ================= */

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 1rem;
  width: max-content; max-width: calc(100vw - 32px);
  padding: .8rem 1.1rem; border-radius: var(--r-pill);
  background: var(--strong-bg); color: var(--on-strong);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .4);
}
.toast[hidden] { display: none; }
.toast-btn { font-weight: 500; background: var(--hi); color: var(--hi-ink); border: 0; cursor: pointer; padding: .3rem .8rem; border-radius: var(--r-pill); }
@media (min-width: 960px) { .toast { bottom: 2rem; } }

dialog {
  border: 0; padding: 0; border-radius: var(--r-card);
  background: var(--panel); color: var(--ink);
  width: min(480px, calc(100vw - 24px));
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, .45);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.sheet { display: flex; flex-direction: column; gap: .9rem; padding: 1.4rem; }
.sheet h2 { font-size: 1.35rem; overflow-wrap: anywhere; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.sheet-actions .btn:last-child { grid-column: 1 / -1; }
.pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; max-height: 50vh; overflow-y: auto; }
.pick { width: 100%; text-align: left; display: flex; flex-direction: column; padding: .7rem .9rem; border-radius: var(--r-row); border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 500; }
.pick:hover { border-color: var(--ink); }

/* Thème sombre choisi dans les réglages */
:root[data-theme="dark"] .tile-hero { outline: 1px solid rgba(255, 255, 255, .18); outline-offset: -1px; }

/* ================= Calme ================= */

.calm *, .calm *::before, .calm *::after { transition: none !important; animation: none !important; }
kbd { font-family: inherit; font-size: .8em; padding: .05em .4em; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); }

/* ================= Navigation latérale ================= */

.side-foot { display: flex; flex-direction: column; gap: .5rem; }
.side-hint { font-size: .75rem; color: var(--ink-soft); text-align: center; }

/* ================= Messages doux ================= */

.soft-note {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  padding: .8rem 1rem .8rem 1.1rem; border-radius: var(--r-row);
  background: var(--panel); border: 1px solid var(--line);
}
.soft-note p { flex: 1; min-width: 200px; }
.soft-note > .ico { color: var(--ink-soft); }

.drain { height: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); overflow: hidden; margin-top: .3rem; }
.drain i { display: block; height: 100%; border-radius: inherit; background: var(--hi); transition: width 1s linear; }
.chip-btn { border: 0; cursor: pointer; color: inherit; text-align: left; }
.chip-btn:hover { background: rgba(255, 255, 255, .24); }

.toggle-pill {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  padding: .4rem .85rem; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--panel); font-size: .85rem; color: var(--ink-soft);
}
.toggle-pill.is-on { background: var(--hi); color: var(--hi-ink); border-color: transparent; }

/* ================= Tâches ================= */

.row-main {
  display: flex; flex-direction: column; gap: .15rem; min-width: 0;
  border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit;
}
.row-main:hover .row-title { text-decoration: underline; text-decoration-color: var(--mist); text-underline-offset: 4px; }
.row-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.row-badges:empty { display: none; }
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .55rem; border-radius: var(--r-pill);
  background: var(--panel-2); color: var(--ink-soft); font-size: .74rem; white-space: nowrap;
}
.tag .ico { width: .95em; height: .95em; }
.tag-doing { background: var(--primary-bg); color: var(--primary-ink); }
.tag-waiting, .tag-soon { background: var(--hi); color: var(--hi-ink); }
.tag-easy { background: var(--panel-2); color: var(--ink); }
.row-item.is-done .row-title { text-decoration: line-through; opacity: .55; }
.check.is-checked { background: var(--hi); border-color: var(--mist); color: var(--hi-ink); }
.row-item { transition: border-color .15s; }
.row-item:hover { border-color: color-mix(in srgb, var(--ink) 18%, transparent); }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-start; }
.toolbar .seg { margin-bottom: 0; }
.select-pill {
  flex-direction: row; align-items: center; gap: .3rem;
  padding: 0 .3rem 0 .9rem; border-radius: var(--r-pill);
  background: var(--panel); border: 1px solid var(--line); font-weight: 400; color: var(--ink-soft);
}
.select-pill select { border: 0; background: none; min-height: 44px; padding: 0 .5rem; width: auto; color: var(--ink); cursor: pointer; }
.select-pill select:focus { outline: none; }

.inbox { padding: 1.1rem; border-radius: var(--r-card); border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent); }
.inbox .sec-head { margin-bottom: .6rem; }
.row-inbox { grid-template-columns: auto minmax(0, 1fr); }
.row-inbox .sort-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .35rem; padding-left: 1.6rem; }
@media (min-width: 760px) { .row-inbox { grid-template-columns: auto minmax(0, 1fr) auto; } .row-inbox .sort-btns { grid-column: auto; padding-left: 0; } }
.inbox-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hi); margin: 0 .3rem; }

.mini-chip {
  display: inline-flex; align-items: center; gap: .3rem; cursor: pointer;
  padding: .35rem .75rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: .84rem;
}
.mini-chip:hover { border-color: var(--ink); }
.mini-chip.is-on { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; }

.task-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: var(--r-pill); border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); background: none; cursor: pointer; font-size: .88rem; color: var(--ink); }

.prio-open { display: flex; flex-direction: column; gap: .2rem; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.prio-title { display: block; font-weight: 400; font-size: 1.05rem; }

/* ================= Panneau latéral (éditeur) ================= */

dialog.is-drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh;
  width: min(560px, 100vw); border-radius: var(--r-card) 0 0 var(--r-card);
}
@media (max-width: 640px) { dialog.is-drawer { margin-top: auto; height: 94dvh; width: 100vw; border-radius: var(--r-card) var(--r-card) 0 0; } }
.drawer { display: flex; flex-direction: column; height: 100%; }
.drawer-head, .drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem 1.25rem; }
.drawer-head { border-bottom: 1px solid var(--line); }
.drawer-foot { border-top: 1px solid var(--line); justify-content: flex-start; flex-wrap: wrap; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }
.drawer-body > * { flex-shrink: 0; }
.title-input {
  font: inherit; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.03em; color: var(--ink);
  border: 0; background: none; padding: 0; resize: none; width: 100%; min-height: 3.6rem;
}
.title-input:focus { outline: none; }
.title-input::placeholder { color: var(--ink-soft); opacity: .6; }
.field { display: flex; flex-direction: column; gap: .45rem; }
.field-label { font-size: .92rem; font-weight: 500; }
.field-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.opt { font-weight: 400; font-size: .8rem; color: var(--ink-soft); }
.hint-line { font-weight: 400; font-size: .8rem; color: var(--ink-soft); }
.quick-dates { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.date-mini { width: auto; min-height: 36px; padding: .25rem .7rem; border-radius: var(--r-pill); font-size: .84rem; }
.status-pills { display: flex; flex-wrap: wrap; gap: .35rem; }
.status-pill { cursor: pointer; padding: .4rem .8rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--panel); color: var(--ink-soft); font-size: .85rem; }
.status-pill.is-on { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; }
.check-line.is-disabled { opacity: .6; }
textarea { font: inherit; color: var(--ink); width: 100%; background: var(--panel-2); border: 1px solid transparent; border-radius: 14px; padding: .7rem .9rem; resize: vertical; font-weight: 400; line-height: 1.5; }
textarea:focus { outline: 3px solid color-mix(in srgb, var(--mist) 70%, transparent); border-color: var(--ink); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; font-weight: 400; }
.select-pill select { background-image: none; padding-right: .5rem; }

.sub { display: flex; flex-direction: column; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sub-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.bar { height: 6px; border-radius: var(--r-pill); background: var(--panel-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
.project-card .bar i { background: var(--accent); }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.checklist li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem .4rem; border-radius: 10px; }
.checklist li:hover { background: var(--panel-2); }
.checklist label { flex-direction: row; align-items: center; gap: .6rem; font-weight: 400; font-size: .98rem; cursor: pointer; }
.checklist .is-done span { text-decoration: line-through; opacity: .55; }
.icon-btn-s { width: 32px; height: 32px; }
.inline-add { display: flex; gap: .5rem; align-items: center; }
.inline-add input { min-height: 42px; }
.split-btn { align-self: flex-start; }
.suggest { display: flex; flex-direction: column; gap: .5rem; padding: .8rem; border-radius: var(--r-row); background: var(--panel-2); }
.suggest-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.suggest .btn { align-self: flex-start; }
.saved-note { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--ink-soft); margin-left: auto; }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.log li { display: grid; grid-template-columns: 12px 1fr; gap: .7rem; align-items: start; position: relative; }
.log li:not(:last-child)::after { content: ''; position: absolute; left: 5px; top: 16px; bottom: -12px; width: 2px; background: var(--line); }
.log-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--hi); margin-top: .35rem; }

.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* ================= Capture ================= */

.capture-field { display: flex; gap: .5rem; align-items: center; }
.capture-field input { font-size: 1.1rem; min-height: 54px; }
.mic { flex: none; width: 52px; height: 52px; cursor: pointer; }
.mic.is-listening { background: var(--hi); color: var(--hi-ink); border-color: transparent; }
.captured { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; color: var(--ink-soft); font-size: .92rem; }

/* ================= Mode focus ================= */

dialog.is-focus {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0;
  background: var(--strong-bg); color: var(--on-strong);
}
.focus { display: flex; flex-direction: column; height: 100%; padding: calc(1rem + env(safe-area-inset-top)) clamp(16px, 4vw, 3rem) calc(1rem + env(safe-area-inset-bottom)); gap: 1.5rem; overflow-y: auto; }
.focus-head, .focus-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.focus-foot { justify-content: center; }
.focus-body { flex: 1; display: grid; gap: 2rem; align-items: center; max-width: 1100px; width: 100%; margin: 0 auto; }
@media (min-width: 860px) { .focus-body { grid-template-columns: 1.2fr 1fr; } }
.focus-task { display: flex; flex-direction: column; gap: 1.2rem; }
.focus-title { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 400; line-height: 1.05; letter-spacing: -.04em; }
.focus-step { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; padding: 1.1rem 1.2rem; border-radius: var(--r-card); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.focus-step p { font-size: 1.25rem; letter-spacing: -.02em; }
.focus-next { color: rgba(255, 255, 255, .75); display: flex; gap: .4rem; align-items: center; }
.focus-next:empty { display: none; }
.focus-timer { display: flex; flex-direction: column; align-items: center; gap: 1rem; position: relative; }
.timer-ring { width: min(300px, 70vw); height: auto; transform: rotate(-90deg); }
.tr-bg { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 8; }
.tr-fg { fill: none; stroke: var(--mist); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-text { position: absolute; top: calc(min(300px, 70vw) / 2); transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; }
.timer-text b { font-size: clamp(2.6rem, 8vw, 3.6rem); font-weight: 400; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.timer-text span { font-size: .8rem; opacity: .7; }
.timer-presets { display: flex; gap: .4rem; }
.focus .mini-chip { background: rgba(255, 255, 255, .08); color: var(--on-strong); border-color: rgba(255, 255, 255, .2); }
.focus .mini-chip.is-on { background: var(--hi); color: var(--hi-ink); }

/* ================= Projets ================= */

.project-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card {
  display: flex; flex-direction: column; gap: .75rem; text-decoration: none;
  padding: 1.1rem; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.project-card:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); transform: translateY(-1px); }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.pc-client { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; color: var(--ink-soft); min-width: 0; }
.pc-pct { font-size: 2.2rem; font-weight: 400; letter-spacing: -.05em; line-height: .9; }
.pc-pct small { font-size: .45em; margin-left: 2px; }
.pc-title { font-size: 1.08rem; letter-spacing: -.02em; line-height: 1.25; }
.pc-foot { display: flex; flex-wrap: wrap; gap: .3rem; }
.avatar-s { width: 24px; height: 24px; font-size: .6rem; }
.avatar-l { width: 46px; height: 46px; font-size: .9rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.2rem; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: .6rem; scroll-snap-type: x mandatory; }
.board-col { display: flex; flex-direction: column; gap: .6rem; padding: .7rem; border-radius: var(--r-card); background: var(--panel-2); scroll-snap-align: start; min-height: 140px; }
.board-col.is-empty { opacity: .7; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: .2rem .4rem; font-size: .9rem; }
.board-head b { min-width: 1.5rem; text-align: center; border-radius: var(--r-pill); background: var(--panel); font-size: .75rem; line-height: 1.5rem; font-weight: 400; }
.board-empty { font-size: .82rem; color: var(--ink-soft); padding: .5rem; }
.board .project-card { box-shadow: none; }

.client-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.client-card { display: flex; flex-direction: column; gap: .45rem; text-decoration: none; padding: 1.2rem; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.client-card:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .3rem; }
.cc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.cc-stats div { display: flex; flex-direction: column; }
.cc-stats b { font-size: 1.15rem; font-weight: 400; letter-spacing: -.02em; }
.cc-stats span { font-size: .72rem; color: var(--ink-soft); line-height: 1.2; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .88rem; color: var(--ink-soft); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { color: var(--ink); }
.crumbs .ico { width: .9em; height: .9em; }

.hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: flex-start; }
.hero-title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 400; letter-spacing: -.04em; margin-top: .4rem; }
.hero-kpis { display: flex; gap: 2rem; }
.hero-num small { font-size: .45em; margin-left: 2px; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.step { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; border: 0; background: none; cursor: pointer; color: inherit; padding: .5rem 0 0; border-top: 3px solid rgba(255, 255, 255, .18); text-align: left; }
.step.is-done { border-top-color: var(--mist); }
.step.is-current { border-top-color: var(--on-strong); }
.step-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .12); font-size: .75rem; }
.step.is-done .step-dot { background: var(--hi); color: var(--hi-ink); }
.step.is-current .step-dot { background: var(--on-strong); color: var(--hi-ink); }
.step-label { font-size: .75rem; opacity: .85; line-height: 1.2; }
@media (max-width: 640px) { .step-label { display: none; } .step.is-current .step-label { display: block; } }

.split { display: grid; gap: 1.5rem; }
.split-main { display: flex; flex-direction: column; gap: 1.6rem; min-width: 0; }
.split-side { display: flex; flex-direction: column; gap: .8rem; min-width: 0; }
@media (min-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; } .split-side { position: sticky; top: 1rem; } }
.link-field { display: flex; gap: .4rem; align-items: center; }
.done-block { margin-top: .8rem; }
.done-block summary { cursor: pointer; color: var(--ink-soft); font-size: .9rem; padding: .4rem 0; }
.client-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.2rem; }
.client-head > div:nth-child(2) { flex: 1; min-width: 200px; }

label input, label select, label textarea { font-weight: 400; }
@media (max-width: 639px) {
  .prio-card.is-empty ~ .prio-card.is-empty { display: none; }
  .prio-card.is-empty { min-height: 84px; flex-direction: row; }
  .prio-card { min-height: 0; }
}

/* Logo officiel (jamais recomposé) : noir en clair, blanc en sombre */
.brand .logo { display: block; height: auto; width: 148px; border-radius: 0; }
.brand-mobile .logo { width: 116px; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none !important; } :root:not([data-theme="light"]) .logo-dark { display: block !important; } }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
.sidebar .brand { margin: -.6rem 0 -.4rem .2rem; }

/* ================= Assistant ================= */

.assistant {
  position: fixed; z-index: 30; top: 0; right: 0; bottom: 0;
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px -30px rgba(0, 0, 0, .35);
}
.assistant[hidden] { display: none; }
@media (min-width: 1680px) { body.assistant-open .shell { margin-right: 440px; } }
@media (max-width: 640px) { .assistant { left: 0; width: 100%; border-left: 0; } .ai-title { font-size: 1rem; } }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: calc(1rem + env(safe-area-inset-top)) 1.1rem 1rem; border-bottom: 1px solid var(--line); }
.ai-title { font-size: 1.1rem; letter-spacing: -.02em; }
.ai-thread { flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: .8rem; }
.ai-msg { max-width: 92%; padding: .75rem .95rem; border-radius: 18px; line-height: 1.5; font-size: .97rem; }
.ai-user { align-self: flex-end; background: var(--primary-bg); color: var(--primary-ink); border-bottom-right-radius: 6px; }
.ai-bot { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 6px; display: flex; flex-direction: column; gap: .7rem; }
.ai-bot .li { display: block; padding-left: 1em; text-indent: -1em; }
.ai-bot .li::before { content: '– '; }
.ai-note { display: flex; gap: .5rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--r-row); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); font-size: .9rem; }
.ai-empty { display: flex; flex-direction: column; gap: .7rem; padding: .5rem .2rem; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: .4rem; }
.ai-action { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.ai-action.is-pending { box-shadow: inset 3px 0 0 var(--accent); }
.ai-action.is-skipped { opacity: .55; }
.ai-action-title { font-weight: 500; }
.ai-action ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: .15rem; }
.ai-action-state { font-size: .85rem; color: var(--ink-soft); display: flex; align-items: center; gap: .35rem; }
.ai-typing { flex-direction: row; gap: 5px; padding: .9rem 1rem; }
.ai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: ai-dot 1.2s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-compose { border-top: 1px solid var(--line); padding: .9rem 1.1rem calc(.9rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .5rem; }
.ai-compose textarea { resize: none; min-height: 64px; }
.ai-compose-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ai-compose .mic { width: 40px; height: 40px; }
.ai-btn { color: var(--accent-text); }
.ai-head .row { flex-wrap: nowrap; }

/* En sombre, les surfaces bordeaux gardent un léger filet pour se détacher du fond */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile-hero, :root:not([data-theme="light"]) .banner, :root:not([data-theme="light"]) .hero, :root:not([data-theme="light"]) .tabbar { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); } }
:root[data-theme="dark"] .tile-hero, :root[data-theme="dark"] .banner, :root[data-theme="dark"] .hero, :root[data-theme="dark"] .tabbar { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

/* ================= Crème de la charte : réservé aux boutons secondaires =================
   Fonds et textes restent noir et blanc ; boutons principaux en bordeaux ;
   boutons secondaires, puces et petits contrôles en crème. */
:root { --creme: #FBF3DE; --creme-hover: #F3E6C2; --on-creme: #111111; }

.btn-soft, .btn-light,
.mini-chip, .status-pill, .chip span, .toggle-pill, .pill-btn,
.day-btn, .round-btn, .go, .select-pill, .hello-links .ico, .week-nav, .banner-btn {
  background: var(--creme);
  color: var(--on-creme);
  border-color: transparent;
}
.btn-light { color: var(--bordeaux); }
.btn-soft:hover, .mini-chip:hover, .status-pill:hover, .toggle-pill:hover, .pill-btn:hover,
.day-btn:hover, .round-btn:hover, .go:hover, .chip span:hover { background: var(--creme-hover); border-color: transparent; }
.select-pill select { color: var(--on-creme); }
.tile-hero .go { background: var(--creme); color: var(--bordeaux); }
.focus .mini-chip { background: var(--creme); color: var(--on-creme); border-color: transparent; }
.ai-btn { color: var(--bordeaux); }

/* État sélectionné : toujours bordeaux */
.mini-chip.is-on, .status-pill.is-on, .chip input:checked + span, .day-btn.is-on,
.toggle-pill.is-on, .pill-btn.pill-strong, .focus .mini-chip.is-on {
  background: var(--primary-bg); color: var(--primary-ink);
}
input[type=checkbox], input[type=radio] { accent-color: var(--bordeaux); }
.cal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: .1rem; }
.ev-chip .cal-dot { margin-right: .35rem; vertical-align: baseline; }

/* Semaine : un bloc court ne doit pas couper l'information */
.block { border: 0; cursor: pointer; text-align: left; min-height: 20px; display: block; font-family: inherit; }
.week-big .block { min-height: 34px; padding: 5px 7px; font-size: .72rem; }
.block-titre { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.block:hover, .block:focus-visible {
  z-index: 6; height: auto !important; min-height: max-content;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45); outline: 2px solid var(--ink); outline-offset: 1px;
}
.block:hover .block-titre, .block:focus-visible .block-titre { -webkit-line-clamp: 6; }
.wk-body { overflow: visible; }
.block { position: absolute; right: auto; }
.block:hover, .block:focus-visible { width: max(160px, 100%) !important; }

/* ================= Agenda : la journée en clair ================= */

.jour-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.jour-item {
  display: grid; grid-template-columns: 4.6rem minmax(0, 1fr) auto; align-items: center; gap: .9rem;
  padding: .8rem 1rem; border-radius: var(--r-row); background: var(--panel); border: 1px solid var(--line);
}
.jour-item.is-past { opacity: .5; }
.jour-heure { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; font-weight: 500; }
.jour-heure small { font-weight: 400; color: var(--ink-soft); }
.jour-corps { display: flex; flex-direction: column; gap: .15rem; min-width: 0; text-align: left; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; }
.jour-titre { font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.jour-corps:hover .jour-titre { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) {
  .jour-item { grid-template-columns: 4.2rem minmax(0, 1fr); }
  .jour-item .btn { grid-column: 2; justify-self: start; }
}

/* La semaine n'est plus qu'un aperçu : des barres, aucun texte */
.wk-day { width: 100%; border: 0; background: none; cursor: pointer; color: var(--ink-soft); font: inherit; }
.wk-body { width: 100%; border: 0; padding: 0; cursor: pointer; }
.wk-col.is-choisi .wk-day { background: var(--primary-bg); color: var(--primary-ink); border-radius: var(--r-pill); }
.wk-col.is-choisi .wk-day b { color: var(--primary-ink); }
.wk-col.is-choisi .wk-body { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 10px; }
.wk-n { font-style: normal; font-size: .6rem; opacity: .75; }
.block { pointer-events: none; min-height: 6px; }
.block:hover, .block:focus-visible { width: inherit !important; height: inherit !important; box-shadow: none; outline: none; }


/* ================= Semaine : lisible, avec défilement horizontal ================= */

.wk-grid { grid-template-columns: 34px repeat(7, minmax(150px, 1fr)); overflow-x: auto; overflow-y: visible; padding-bottom: .4rem; }
.week .wk-body, .week .wk-hours { height: 430px; }
.wk-hours { margin-top: 56px; }
.block {
  pointer-events: auto; cursor: pointer; border: 0; text-align: left;
  min-height: 24px; padding: 4px 6px; font-size: .72rem; line-height: 1.2;
  display: flex; flex-direction: column; gap: 1px;
}
.block small { font-weight: 500; opacity: .85; }
.block-titre { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.block:hover, .block:focus-visible {
  z-index: 8; height: auto !important; min-height: max-content; width: max(190px, 100%) !important;
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .5); outline: 2px solid var(--ink); outline-offset: 1px;
}
.block:hover .block-titre, .block:focus-visible .block-titre { -webkit-line-clamp: 8; }
.wk-col.is-choisi .wk-body { outline: 2px dashed color-mix(in srgb, var(--ink) 35%, transparent); outline-offset: 3px; }


/* Un rendez-vous court tient sur une ligne : heure et titre côte à côte */
.week .wk-body, .week .wk-hours { height: 560px; }
.block.is-court { flex-direction: row; align-items: center; gap: .35rem; min-height: 19px; padding: 2px 6px; }
.block.is-court small { flex: none; }
.block.is-court .block-titre { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block:hover.is-court, .block:focus-visible.is-court { flex-direction: column; align-items: flex-start; padding: 4px 6px; }
.block:hover.is-court .block-titre, .block:focus-visible.is-court .block-titre { white-space: normal; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; }


/* ================= Agenda en grand : plus d'air, vue d'ensemble ================= */

.week-big { padding: 1.5rem; }
.week-big .wk-grid { grid-template-columns: 44px repeat(7, minmax(190px, 1fr)); gap: 8px; }
.week-big .wk-body, .week-big .wk-hours { height: 820px; }
.week-big .wk-hours { margin-top: 64px; }
.week-big .wk-hours span { font-size: .72rem; }
/* un trait par heure, plus marqué toutes les 3 heures */
.week-big .wk-body {
  background:
    repeating-linear-gradient(to bottom, transparent 0 calc(8.333% - 1px), var(--line) calc(8.333% - 1px) 8.333%),
    repeating-linear-gradient(to bottom, transparent 0 calc(25% - 1px), color-mix(in srgb, var(--ink) 18%, transparent) calc(25% - 1px) 25%);
  border-radius: 14px;
}
.week-big .wk-day { height: 58px; font-size: .78rem; }
.week-big .wk-day b { font-size: 1.25rem; }
.week-big .block { font-size: .78rem; padding: 6px 8px; min-height: 26px; border-radius: 10px; }
.week-big .block.is-court { min-height: 22px; padding: 3px 8px; }
.week-big .block small { font-size: .72rem; }

/* Dans la colonne de droite du tableau de bord, la semaine reste compacte */
.dash-rail .week .wk-body, .dash-rail .week .wk-hours { height: 300px; }
.dash-rail .wk-grid { grid-template-columns: 26px repeat(7, minmax(0, 1fr)); }
.dash-rail .block { font-size: 0; min-height: 8px; padding: 0; }

/* Pas de défilement dans le calendrier : les 7 jours tiennent dans la largeur disponible */
.wk-grid, .week-big .wk-grid { overflow: visible; }
.week-big .wk-grid { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-big .block { font-size: .74rem; padding: 5px 6px; }
.week-big .block small { font-size: .68rem; }
.block-titre { overflow-wrap: anywhere; }
/* Le bloc survolé peut déborder sur ses voisins, mais jamais hors de la page */
.week-big .block:hover, .week-big .block:focus-visible { width: max(210px, 100%) !important; max-width: 280px; }
.week-big .wk-col:nth-last-child(-n+2) .block:hover,
.week-big .wk-col:nth-last-child(-n+2) .block:focus-visible { left: auto !important; right: 0; }
