/* Outil HERA, charte HeraHub, interface façon application */
:root {
  --bg: #FAF8F4;
  --card: #FFFFFF;
  --alt: #F1ECE2;
  --border: #E6E1D5;
  --border-strong: #CFC8B7;
  --title: #1F2127;
  --body: #3F434B;
  --muted: #6B6F77;
  --faint: #9AA0A8;
  --accent: #6644D8;
  --accent-hover: #8064E8;
  --accent-pressed: #4A2FA0;
  --swoosh: #B8A2FF;
  --tint: #EFEAFB;
  --tint-ink: #4A2FA0;
  --success: #16A34A;
  --success-tint: #E6F4EA;
  --warning: #D97706;
  --warning-tint: #FCEFDC;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 2px rgba(31, 33, 39, .03);
  --sidebar: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--title); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; }
h2 { font-size: clamp(18px, 1.8vw, 21px); line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.hidden { display: none !important; }

/* ---------- Surfaces translucides ---------- */
.glass {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px -18px rgba(31, 33, 39, .25);
}
/* Les barres mobiles laissent deviner le contenu qui défile dessous. */
.mtop.glass, .tabbar.glass {
  background: rgba(250, 248, 244, .86);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}

/* ---------- Barre latérale : à plat sur l'ivoire, texte d'abord ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar);
  padding: 22px 14px 16px; z-index: 30; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: none;
}
.sidebar.glass { background: var(--bg); border-width: 0 1px 0 0; box-shadow: none; }
.sidebar::-webkit-scrollbar { display: none; }
.sb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--title); padding: 0 8px 6px; }
.sb-brand b { display: block; font-weight: 800; font-size: 14.5px; letter-spacing: -0.01em; line-height: 1.2; }
.sb-brand small { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.sb-logo { width: 28px; height: 28px; flex: none; object-fit: contain; }
.sb-profile {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--title);
  transition: background .15s var(--ease);
}
.sb-profile:hover { background: rgba(31, 33, 39, .04); color: var(--title); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px;
  background: var(--tint); color: var(--tint-ink); font-weight: 800;
}
.sb-txt { display: flex; flex-direction: column; min-width: 0; }
.sb-txt b { font-weight: 600; font-size: 13.5px; color: var(--title); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-nav .sb-item .sb-txt small { display: none; }
.sb-label { font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 16px 8px 6px; }
.sb-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; min-height: 36px;
  text-decoration: none; color: var(--body); transition: background .15s var(--ease);
}
.sb-item:hover { background: rgba(31, 33, 39, .04); color: var(--title); }
.sb-item.active { background: var(--alt); }
.sb-item.active .sb-txt b { color: var(--title); }
.sb-item .sb-txt b { font-weight: 600; color: var(--body); }
.sb-ico { width: 20px; height: 20px; display: grid; place-items: center; flex: none; color: var(--muted); }
.sb-item.active .sb-ico { color: var(--title); }
.sb-ico svg, .sb-letter svg, .sb-lock svg, .tab-ico svg, .lock-ico svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.sb-letter svg { width: 11px; height: 11px; stroke-width: 3; }
.sb-steps { position: relative; display: flex; flex-direction: column; gap: 1px; }
.sb-steps::before {
  content: ""; position: absolute; left: 18px; top: 22px; bottom: 22px; width: 1px;
  background: var(--border);
}
.sb-letter {
  position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 10.5px;
  background: var(--bg); color: var(--accent); border: 1px solid rgba(102, 68, 216, .45);
  transition: all .3s var(--ease);
}
.sb-step.fait .sb-letter { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.sb-step.active .sb-letter { box-shadow: 0 0 0 3px rgba(102, 68, 216, .16); }
.sb-step.encours:not(.active) .sb-letter { animation: halo 2.4s ease-in-out infinite; }
.sb-item.verrou { opacity: .5; cursor: not-allowed; }
.sb-item.verrou:hover { background: transparent; }
.sb-step.verrou .sb-letter { background: var(--bg); color: var(--muted); border-color: var(--border-strong); }
.sb-lock { margin-left: auto; color: var(--muted); display: grid; }
.sb-lock svg { width: 13px; height: 13px; }
@keyframes halo { 0%, 100% { box-shadow: 0 0 0 0 rgba(102, 68, 216, .3); } 50% { box-shadow: 0 0 0 5px rgba(102, 68, 216, 0); } }

.sb-progress { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--border); }
.sb-progress-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 8px; color: var(--muted); }
.sb-progress-head b { color: var(--title); }
.sb-progress .bar { height: 4px; }
.sb-foot { display: flex; flex-direction: column; gap: 8px; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; transition: background .15s var(--ease); }
.switch-row:hover { background: rgba(31, 33, 39, .04); }
.switch-row .sb-txt { flex: 1; }
.switch {
  position: relative; width: 36px; height: 22px; border-radius: 999px; flex: none;
  background: rgba(107, 111, 119, .28); transition: background .25s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(31, 33, 39, .25); transition: transform .3s var(--ease);
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }
.sb-demo { display: flex; gap: 6px; padding: 0 8px; }
.sb-demo button {
  flex: 1; border: 1px solid var(--border); background: var(--card); border-radius: 999px;
  padding: 5px 6px; font-size: 11px; font-weight: 700; color: var(--title); cursor: pointer; white-space: nowrap;
}
.sb-demo button:hover { border-color: var(--accent); color: var(--accent); }
.sb-note { font-size: 11.5px; color: var(--muted); padding: 0 8px; line-height: 1.5; }

.sb-argos { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .8); }
.sb-argos img { width: 34px; height: 34px; flex: none; }
.sb-argos + .sb-progress { margin-top: 0; }

.argos { display: flex; gap: 12px; align-items: flex-start; margin: -6px 0 24px; max-width: 760px; }
.argos-av {
  width: 34px; height: 34px; flex: none; border-radius: 50%; padding: 3px; background: #fff;
  border: 1px solid var(--border);
}
.argos.pense .argos-av, .sb-argos.pense img { animation: tourne 1.6s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.argos-bulle {
  background: var(--card); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px;
  padding: 9px 14px 10px; transform-origin: top left;
}
.view.enter .argos-bulle { animation: bulle .55s var(--ease) both .12s; }
@keyframes bulle { from { opacity: 0; transform: scale(.94) translateY(4px); } to { opacity: 1; transform: none; } }
.argos-nom { font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.argos-bulle p { margin-top: 1px; color: var(--title); font-weight: 500; font-size: 14px; line-height: 1.5; }
.dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: point 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes point { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Barres mobiles ---------- */
.mtop, .tabbar { display: none; }

/* ---------- Zone principale ---------- */
.main { margin-left: var(--sidebar); padding: 28px 48px 80px; min-height: 100vh; }
.view { max-width: 1040px; margin: 0 auto; }
.view.enter { animation: enter .45s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { padding: 18px 0 26px; max-width: 760px; }
.page-head h1 { margin-top: 8px; }
.page-head .lead { margin-top: 10px; font-size: 15.5px; max-width: 640px; }
.page-head .meta, .crumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.page-head .meta { margin-top: 18px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--bg);
  font-weight: 700; font-size: 14px; text-decoration: none; cursor: pointer;
  box-shadow: none;
  transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--accent-hover); color: var(--bg); }
.btn:active { background: var(--accent-pressed); transform: scale(.97); }
.btn.arrow::after { content: "→"; transition: transform .2s var(--ease); }
.btn.arrow:hover::after { transform: translateX(3px); }
.btn[disabled] { background: var(--border-strong); box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: var(--card); color: var(--title); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.small { padding: 7px 15px; font-size: 13px; }
.btn.link { background: none; color: var(--accent); padding: 8px 4px; box-shadow: none; }
.btn.link:hover { color: var(--accent-hover); }
.btn.locked { background: var(--alt); color: var(--muted); box-shadow: none; cursor: not-allowed; font-weight: 600; }
.btn .spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(250, 248, 244, .4); border-top-color: var(--bg);
  animation: spin .8s linear infinite;
}
.lock-ico { display: inline-grid; }
.lock-ico svg { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.shake { animation: shake .45s var(--ease); }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ---------- Typo utilitaires ---------- */
.kicker { color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.label { font-weight: 600; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--alt); color: var(--muted);
}
.pill.violet { background: var(--tint); color: var(--tint-ink); }
.pill.ok { background: var(--success-tint); color: var(--success); }
.pill.warn { background: var(--warning-tint); color: var(--warning); }
.pill.outline { background: rgba(255, 255, 255, .7); border: 1px solid var(--border); color: var(--title); }

.swoosh { position: relative; display: inline-block; white-space: nowrap; }
.swoosh > svg { position: absolute; left: 0; width: 100%; height: 0.3em; bottom: -0.28em; overflow: visible; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.chip {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: inline-grid; place-items: center; background: var(--tint); color: var(--tint-ink);
}
.chip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.callout {
  background: var(--tint); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 22px;
  color: var(--title); font-weight: 600;
}
.callout p + p { margin-top: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { position: relative; padding: 9px 0 9px 18px; border-bottom: 1px dashed var(--border); }
.list li:last-child { border-bottom: 0; }
.list li::before { content: ""; position: absolute; left: 0; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.grid { display: grid; gap: 16px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card + .card { margin-top: 0; }
.section { margin-top: 36px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { margin-top: 6px; }

/* ---------- Accueil (tableau de bord) ---------- */
.next-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 24px; }
.next-card h2 { margin-top: 8px; }
.next-card p { margin-top: 10px; max-width: 560px; }
.next-card .actions { margin-top: 20px; }
.next-letter {
  width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center;
  font-size: 36px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em;
  background: var(--tint); box-shadow: inset 0 1px 0 #fff;
}
.step-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--body); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.step-card:hover { transform: translateY(-3px); border-color: rgba(102, 68, 216, .45); color: var(--body); box-shadow: 0 18px 40px -22px rgba(74, 47, 160, .45); }
.step-card .top { display: flex; align-items: center; justify-content: space-between; }
.step-card .big { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1; letter-spacing: -0.02em; }
.step-card .liv { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 14px; }
.step-card .liv b { display: block; font-weight: 600; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.step-card.verrou { background: rgba(255, 255, 255, .55); cursor: not-allowed; box-shadow: none; }
.step-card.verrou:hover { transform: none; border-color: var(--border); box-shadow: none; }
.step-card.verrou .big, .step-card.verrou h3 { color: var(--faint); }
.state-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--alt); color: var(--muted); }
.state-ico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.state-ico.fait { background: var(--accent); color: var(--bg); }
.state-ico.encours { background: var(--tint); color: var(--tint-ink); }
.plan-row { display: flex; gap: 16px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.plan-row:last-child { border-bottom: 0; }
.plan-row .when { min-width: 132px; }

/* ---------- Page d'étape ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.aside .card { padding: 20px; margin-top: 0; }
.aside h4 { font-size: 15px; margin-bottom: 6px; }
.aside .list li { font-size: 14px; }

.block { margin-bottom: 16px; transition: opacity .3s var(--ease); }
.card.block + .card.block { margin-top: 0; }
.block-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.num {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--alt); color: var(--muted); font-weight: 800; font-size: 15px; transition: all .3s var(--ease);
}
.num svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.block.ready .num { background: var(--accent); color: var(--bg); box-shadow: 0 0 0 5px rgba(102, 68, 216, .14); }
.block.complete .num { background: var(--tint); color: var(--tint-ink); }
.block-head p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.block.locked { opacity: .6; box-shadow: none; background: rgba(255, 255, 255, .6); }
.block.locked .block-head { margin-bottom: 4px; }
.locked-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 15px; padding: 4px 0 4px 48px; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; color: var(--title); }
.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--card);
  font-weight: 500; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.textarea { min-height: 200px; resize: vertical; line-height: 1.55; }
.textarea.short { min-height: 96px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; }

.dictee { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.mic {
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: var(--accent); color: var(--bg); display: grid; place-items: center;
  box-shadow: 0 10px 24px -10px rgba(74, 47, 160, .8); transition: transform .15s var(--ease);
}
.mic:active { transform: scale(.94); }
.mic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mic.on { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(102, 68, 216, .35); } 50% { box-shadow: 0 0 0 14px rgba(102, 68, 216, 0); } }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--card); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--body);
  transition: all .2s var(--ease);
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(.97); }
.choice.on { background: var(--tint); border-color: var(--accent); color: var(--tint-ink); }

.seg { display: inline-flex; border-radius: 999px; padding: 3px; background: var(--alt); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); transition: all .2s var(--ease); }
.seg button.on { background: #fff; color: var(--tint-ink); box-shadow: 0 1px 3px rgba(31, 33, 39, .12); }

/* Inventaire */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.kpi .v { font-size: 22px; font-weight: 800; color: var(--title); letter-spacing: -0.02em; line-height: 1.2; }
.kpi .t { font-size: 13px; color: var(--muted); }
.card.kpi { background: var(--card); }

.task { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--card); transition: border-color .2s; }
.task:hover { border-color: var(--border-strong); }
.task + .task { margin-top: 10px; }
.task-top { display: flex; gap: 10px; align-items: center; }
.task-top .input { font-weight: 700; color: var(--title); border-color: transparent; padding: 6px 8px; }
.task-top .input:hover { border-color: var(--border); }
.task-cost { margin-left: auto; text-align: right; white-space: nowrap; }
.task-cost b { display: block; font-size: 18px; font-weight: 800; color: var(--title); }
.task-cost span { font-size: 12px; color: var(--muted); }
.task-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.task-line .input, .task-line .select { width: auto; padding: 6px 10px; font-size: 14px; }
.task-line .input.n { width: 72px; }
.task-why { margin-top: 8px; font-size: 14px; color: var(--muted); }
.x { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.x:hover { color: var(--title); background: var(--alt); }

.radio-task {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left;
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--card); cursor: pointer;
  transition: all .2s var(--ease);
}
.radio-task + .radio-task { margin-top: 8px; }
.radio-task:hover { border-color: var(--border-strong); }
.radio-task.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.radio-task .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; transition: all .2s var(--ease); }
.radio-task.on .dot { border: 6px solid var(--accent); }
.radio-task .nm { font-weight: 700; color: var(--title); }
.radio-task .cost { margin-left: auto; font-weight: 700; white-space: nowrap; }

.proc-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.proc-step:last-child { border-bottom: 0; }
.proc-step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--tint-ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.proc-step .body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.proc-step .input { font-weight: 700; color: var(--title); }
.proc-step .textarea { min-height: 64px; font-size: 15px; }

.deliverable { border: 1px solid rgba(102, 68, 216, .55); box-shadow: 0 0 0 4px rgba(102, 68, 216, .08), var(--shadow); }
.deliverable-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.deliverable-head .actions { margin-left: auto; }

.notice { padding: 12px 16px; border-radius: 12px; background: var(--alt); color: var(--body); font-size: 14px; margin-top: 12px; }
.notice.warn { background: var(--warning-tint); color: #8A4B05; }

.bar { height: 8px; border-radius: 999px; background: var(--alt); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s var(--ease); }
.sb-progress .bar { background: rgba(255, 255, 255, .7); }

/* Équiper */
.q + .q { margin-top: 22px; }
.q h4 { font-size: 16px; margin-bottom: 10px; }
.verdict { display: flex; gap: 16px; align-items: flex-start; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.check:last-child { border-bottom: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 3px; flex: none; }

/* Réaliser */
.level { cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 8px; width: 100%; font: inherit; color: inherit; transition: all .2s var(--ease); }
.level:hover { border-color: var(--border-strong); }
.level.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.fiche { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.fiche h4 { font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin: 18px 0 6px; }
.fiche h4:first-of-type { margin-top: 0; }
.fiche .ex { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 8px; font-size: 15px; }
.fiche .ex pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; color: var(--title); }
.fiche .titre-fiche { font-size: 20px; }

/* Analyser */
.entries { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.entry { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--alt); font-size: 14px; font-weight: 600; }
.compare { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.compare .line { display: grid; grid-template-columns: 90px 1fr 70px; gap: 12px; align-items: center; font-size: 14px; }
.compare .bar > span.before { background: var(--border-strong); }
.big-verdict { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.big-verdict.ok { color: var(--success); }
.big-verdict.warn { color: var(--warning); }
.big-verdict.cut { color: var(--title); }

.step-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Notifications ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: rgba(31, 33, 39, .92); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-weight: 600; font-size: 14px; opacity: 0; transition: .3s var(--ease); pointer-events: none; z-index: 60;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 901px) { .toast { left: calc(50% + var(--sidebar) / 2); } }

.unlock {
  position: fixed; right: 24px; bottom: 24px; z-index: 55; width: min(420px, calc(100vw - 32px));
  display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center;
  padding: 16px; border-radius: 24px;
  opacity: 0; transform: translateY(24px) scale(.96); transition: all .45s var(--ease);
}
.unlock.show { opacity: 1; transform: none; }
.unlock-badge {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  background: var(--accent); color: var(--bg); font-weight: 800; font-size: 26px;
  box-shadow: 0 10px 24px -10px rgba(74, 47, 160, .8);
  animation: pop .6s var(--ease) both .15s;
}
@keyframes pop { 0% { transform: scale(.4) rotate(-12deg); } 70% { transform: scale(1.08) rotate(3deg); } 100% { transform: none; } }
.unlock b { display: block; color: var(--title); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.unlock small { display: block; font-size: 13px; color: var(--body); line-height: 1.4; margin-top: 2px; }
.unlock .actions { grid-column: 1 / -1; justify-content: flex-end; }
.unlock .x { position: absolute; top: 8px; right: 8px; }

/* Indicateurs */
.hero-kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 28px 32px; }
.hero-fig { font-size: clamp(40px, 4.4vw, 52px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--title); margin-top: 14px; }
.hero-sub { margin-top: 8px; font-size: 17px; }
.hero-sub b { color: var(--title); }
.hero-side { display: flex; flex-direction: column; gap: 14px; min-width: 240px; padding-left: 28px; border-left: 1px solid var(--border); }
.hero-side b { display: block; font-size: 22px; font-weight: 800; color: var(--title); letter-spacing: -0.02em; margin-top: 2px; }
.kpi-section { margin: 30px 0 12px; }
.tile { padding: 18px 20px; }
.tile .t { font-size: 13px; color: var(--muted); line-height: 1.35; }
.tile .v { font-size: 22px; font-weight: 800; color: var(--title); letter-spacing: -0.02em; line-height: 1.2; margin-top: 6px; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.chart-card { margin-top: 16px; }
.chart-head { margin-bottom: 16px; }
.chart-head p { margin-top: 4px; }
.chart { width: 100%; min-height: 220px; }
.chart svg { display: block; overflow: visible; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .ref { font-size: 12px; fill: var(--muted); font-weight: 600; font-family: var(--font); }
.chart .end { font-size: 12px; fill: var(--title); font-weight: 700; font-family: var(--font); }
.chart .hit { cursor: crosshair; }

.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar { outline: none; }
.hbar-lab { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hbar-lab b { color: var(--title); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-lab span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.hbar-fill { height: 14px; border-radius: 0 4px 4px 0; background: var(--accent); transition: width .6s var(--ease); }
.hbar:hover .hbar-fill, .hbar:focus .hbar-fill { background: var(--accent-pressed); }
.hbar-val { font-size: 13px; font-weight: 700; color: var(--title); white-space: nowrap; font-variant-numeric: tabular-nums; }

.meter { outline: none; }
.meter + .meter { margin-top: 14px; }
.meter-lab { display: flex; justify-content: space-between; font-size: 14px; }
.meter-lab b { color: var(--title); font-weight: 700; }
.meter-lab span { color: var(--muted); font-size: 13px; }
.meter-track { height: 10px; border-radius: 999px; background: var(--tint); margin-top: 6px; overflow: hidden; }
.meter-track span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.cols { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 210px; padding: 28px 4px 22px; margin-top: 8px; border-bottom: 1px solid var(--border); }
.cols-ref { position: absolute; left: 0; right: 0; top: 28px; bottom: 22px; pointer-events: none; }
.cols-ref::before { content: ""; position: absolute; left: 0; right: 0; bottom: var(--avant); border-top: 1.5px solid #9AA0A8; }
.cols-ref em { position: absolute; right: 0; bottom: calc(var(--avant) + 4px); font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.col { position: relative; flex: 1; max-width: 48px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; }
.col-bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--accent); transition: background .2s; }
.col:hover .col-bar, .col:focus .col-bar { background: var(--accent-pressed); }
.col-lab { position: absolute; bottom: -20px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.table-view { margin-top: 14px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.table-view table, .kpi-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.table-view th, .kpi-table th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); }
.table-view td, .kpi-table td { padding: 7px 8px 7px 0; border-bottom: 1px dashed var(--border); font-variant-numeric: tabular-nums; }
.table-view .r, .kpi-table .r { text-align: right; }

.tip {
  position: fixed; z-index: 70; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  background: rgba(31, 33, 39, .94); color: var(--bg); font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 10px;
  white-space: nowrap; opacity: 0; transition: opacity .15s;
}
.tip.show { opacity: 1; }

/* Dossier */
.dossier table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dossier th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); }
.dossier td { padding: 9px 8px 9px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.dossier td.r, .dossier th.r { text-align: right; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 82px 16px calc(110px + env(safe-area-inset-bottom)); }
  .mtop {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    position: fixed; top: 10px; left: 10px; right: 10px; height: 58px; padding: 0 10px 0 12px; border-radius: 20px; z-index: 30;
  }
  .mtop .sb-brand { padding: 0; }
  .mtop .sb-logo { width: 28px; height: 28px; }
  .mtop-demo {
    display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--card); border-radius: 999px;
    padding: 5px 5px 5px 12px; font-size: 12px; font-weight: 700; color: var(--title); cursor: pointer;
  }
  .mtop-demo .switch { width: 36px; height: 22px; }
  .mtop-demo .switch::after { width: 16px; height: 16px; }
  .mtop-demo .switch.on::after { transform: translateX(14px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr);
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 6px; border-radius: 26px;
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 18px; min-width: 0;
    text-decoration: none; color: var(--title); transition: background .2s var(--ease);
  }
  .tab.active { background: var(--card); box-shadow: 0 1px 3px rgba(31, 33, 39, .1); }
  .tab-ico {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--accent);
  }
  .tab.step .tab-ico { background: #fff; border: 1.5px solid rgba(102, 68, 216, .35); }
  .tab.step.fait .tab-ico { background: var(--accent); color: var(--bg); border-color: var(--accent); }
  .tab.verrou { opacity: .5; }
  .tab.verrou .tab-ico { color: var(--muted); }
  .tab-l { font-size: 9.5px; font-weight: 700; letter-spacing: -0.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar { padding: 6px 4px; }
  .tab { padding: 6px 0; }
  .toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .unlock { right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .hero-kpi { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .hero-side { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); padding-top: 16px; flex-direction: row; flex-wrap: wrap; gap: 18px 28px; }
  .aside { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .page-head { padding: 10px 0 22px; }
  .page-head .lead { font-size: 16px; }
  .argos { gap: 10px; margin-top: -6px; }
  .argos-av { width: 30px; height: 30px; padding: 2px; }
  .grid.g2, .grid.g3, .grid.g4 { grid-template-columns: minmax(0, 1fr); }
  .grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile .v { font-size: 20px; }
  .cols { gap: 6px; }
  .hbar-lab { flex-direction: column; gap: 0; }
  .hbar-lab b { white-space: normal; }
  .card { padding: 18px; }
  .card.block { padding: 16px 14px; }
  .next-card { grid-template-columns: minmax(0, 1fr); padding: 20px; }
  .next-letter { display: none; }
  .kpis { gap: 8px; }
  .kpi { padding: 10px; }
  .kpi .v { font-size: 17px; }
  .kpi .t { font-size: 11px; line-height: 1.35; }
  .task { padding: 12px; }
  .task-top { flex-wrap: wrap; }
  .task-top .input { flex: 1 1 100%; order: -1; padding: 4px 0; font-size: 15px; }
  .task-cost { margin-left: 0; text-align: left; }
  .task-line .input.n { width: 60px; }
  .task-line .seg { margin-left: 0 !important; }
  .plan-row { flex-direction: column; gap: 4px; }
  .compare .line { grid-template-columns: 70px 1fr 56px; }
  .deliverable-head .actions { margin-left: 0; }
  .locked-note { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .mtop, .tabbar, .no-print, .step-nav, #unlock, .argos { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #FAF8F4; font-size: 12px; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* ---------- Outil dans la durée : tâches, suivi, contact ---------- */
.section-sm { margin-top: 16px; }
.sb-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--alt); color: var(--muted); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.sb-task { display: block; margin: 0 8px 6px; font-size: 13px; font-weight: 700; color: var(--title); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-task:hover { color: var(--accent); }
.sb-empty { display: block; margin: 0 4px; padding: 10px; border-radius: 10px; border: 1px dashed var(--border-strong); font-size: 13px; color: var(--body); text-decoration: none; line-height: 1.45; }
.sb-empty b { color: var(--accent); font-weight: 700; }
.sb-empty:hover { background: rgba(31, 33, 39, .04); }
.sb-more { display: block; margin: 2px 8px 0 38px; font-size: 12px; font-weight: 600; color: var(--muted); }
.sb-progress-foot { margin-top: 6px; font-size: 12px; color: var(--muted); }

.crumbs { align-items: center; }
.crumbs a.pill { text-decoration: none; }
.crumb-sep { color: var(--faint); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.st { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--title); font-weight: 600; font-size: 13px; transition: all .2s var(--ease); }
.st:hover { border-color: var(--accent); color: var(--title); }
.st-l { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font-weight: 800; font-size: 11px; }
.st-l svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.st.fait .st-l { background: var(--accent); color: var(--bg); }
.st.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.st.verrou { opacity: .5; cursor: not-allowed; }
.st.verrou .st-l { background: var(--alt); color: var(--muted); }
.st-sep { width: 14px; height: 2px; border-radius: 2px; background: var(--border-strong); }

.how { display: flex; flex-direction: column; gap: 10px; }
.how-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font-weight: 800; }


.conseil .kpi .label { display: block; margin-bottom: 6px; }
.conseil .small-v { font-size: 19px; line-height: 1.3; }
.filters { display: flex; flex-wrap: wrap; gap: 2px; }
.filters button span { margin-left: 4px; font-size: 12px; color: var(--faint); }
.filters button.on span { color: var(--tint-ink); }
.filters button[disabled] { opacity: .45; cursor: default; }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.task-actions .grow { flex: 1 1 200px; }
.task-actions .btn.small { padding: 7px 14px; }
.ink { color: var(--title); font-weight: 700; }
.task.en_service, .task.arretee, .task.coupee, .task.de_cote { background: var(--bg); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .tl-d { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline li.fort span:last-child { color: var(--title); font-weight: 700; }

.fiche-details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 12px; }

.contact-card { display: flex; align-items: center; gap: 16px; }
.contact-av { width: 64px; height: 64px; padding: 6px; border-radius: 50%; background: var(--tint); flex: none; }
.apercu { white-space: pre-wrap; font: inherit; font-size: 14px; margin: 12px 0 0; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); color: var(--body); }

.tab-ico b { font-weight: 800; font-size: 14px; }

@media (max-width: 640px) {
  .stepper { gap: 4px; }
  .st { padding: 4px; }
  .st .st-n { display: none; }
  .st.active .st-n { display: inline; padding-right: 8px; }
  .st-sep { width: 8px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { white-space: nowrap; flex: none; }
  .task-actions .grow { flex-basis: 100%; order: -1; }
  .timeline li { grid-template-columns: 62px minmax(0, 1fr); }
  .hero-side { gap: 14px 20px; }
}
@media print {
  .fiche-details > summary { display: none; }
  .fiche-details:not([open]) > .fiche { display: block; }
}

/* ---------- Mes tâches : groupes, liste et panneau ---------- */
.tk-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .8fr); gap: 14px; margin-top: 8px; }
.tk-tile {
  position: relative; text-align: left; font: inherit; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .15s var(--ease);
}
.tk-tile:hover { border-color: var(--border-strong); }
.tk-tile:active { transform: scale(.98); }
.tk-tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.tk-tile-l { font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tk-tile b { font-size: 24px; font-weight: 800; line-height: 1.15; color: var(--title); letter-spacing: -.02em; }
.tk-tile-s { font-size: 13px; color: var(--muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tk-tile.ecartees { background: transparent; box-shadow: none; }
.tk-tile.ecartees b { color: var(--muted); }
.tk-tile.a_traiter::after, .tk-tile.en_cours::after {
  content: "→"; position: absolute; right: -13px; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg); color: var(--accent); font-size: 13px; font-weight: 700;
}

.tk-bar { display: flex; align-items: center; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.tk-search { flex: 1 1 260px; position: relative; display: flex; align-items: center; }
.tk-search svg { position: absolute; left: 14px; color: var(--faint); pointer-events: none; }
.tk-search input { width: 100%; padding: 11px 16px 11px 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font: inherit; font-size: 15px; color: var(--title); outline: none; transition: border-color .2s, box-shadow .2s; }
.tk-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--tint); }
.tk-tri { display: flex; align-items: center; gap: 8px; }
.tk-tri .select { width: auto; padding: 9px 12px; font-size: 14px; border-radius: 999px; }
.tk-bar .btn { padding: 11px 20px; }

.tk-cats, .dr-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tk-chip { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--body); transition: all .2s var(--ease); }
.tk-chip span { color: var(--faint); margin-left: 2px; }
.tk-chip:hover { border-color: var(--border-strong); }
.tk-chip.on { background: var(--tint); border-color: var(--tint); color: var(--tint-ink); }
.tk-chip.on span { color: var(--tint-ink); }

.tk-sec { margin-top: 28px; }
.tk-sec-head, .tk-sec > summary { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-sec h3 { font-size: 18px; }
.tk-sec h3 span { color: var(--faint); font-weight: 700; margin-left: 4px; }
.tk-sec > summary { cursor: pointer; list-style: none; }
.tk-sec > summary::-webkit-details-marker { display: none; }
.tk-sec > summary h3::before { content: "›"; display: inline-block; margin-right: 8px; color: var(--muted); transition: transform .2s var(--ease); }
.tk-sec[open] > summary h3::before { transform: rotate(90deg); }

.tk-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tk-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 120px auto 14px; align-items: center; gap: 16px;
  padding: 14px 18px; cursor: pointer; transition: background .15s var(--ease); outline: none;
}
.tk-row + .tk-row { border-top: 1px solid var(--border); }
.tk-row:hover, .tk-row:focus-visible { background: #FCFBF8; }
.tk-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.tk-row.flash { animation: flashRow 2.2s var(--ease); }
@keyframes flashRow { 0%, 35% { background: var(--tint); } 100% { background: transparent; } }
.tk-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); justify-self: center; }
.tk-dot.off { border-style: dashed; }
.tk-letter { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--bg); font-weight: 800; font-size: 13px; }
.tk-ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); }
.tk-ok svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tk-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; color: var(--title); line-height: 1.35; }
.tk-name .pill { padding: 3px 9px; font-size: 10.5px; }
.tk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 4px; font-size: 13px; color: var(--muted); }
.tk-meta > * + *::before { content: "·"; margin: 0 8px; color: var(--faint); }
.tk-cat { color: var(--tint-ink); font-weight: 600; }
.tk-steps { display: inline-flex; gap: 3px; }
.tk-steps i { font-style: normal; font-size: 11px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--alt); color: var(--faint); }
.tk-steps i.f { background: var(--tint); color: var(--tint-ink); }
.tk-steps i.c { background: var(--accent); color: var(--bg); }
.tk-val { text-align: right; line-height: 1.3; }
.tk-val b { display: block; font-size: 16px; font-weight: 800; color: var(--title); white-space: nowrap; }
.tk-val span { font-size: 12px; color: var(--muted); }
.tk-act { display: flex; justify-content: flex-end; min-width: 0; }
.tk-act .btn { white-space: nowrap; }
.tk-chev { color: var(--faint); font-size: 22px; line-height: 1; }
.tk-row.de_cote .tk-name, .tk-row.coupee .tk-name { color: var(--muted); }
.tk-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

/* Panneau latéral */
body.drawer-open { overflow: hidden; }
.drawer-bg { position: fixed; inset: 0; z-index: 50; background: rgba(31, 33, 39, .28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 51; width: min(480px, calc(100vw - 24px));
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgba(31, 33, 39, .35); overflow: hidden;
}
.drawer-bg.anim { animation: fondu .25s ease both; }
.drawer.anim { animation: glisse .35s var(--ease) both; }
@keyframes fondu { from { opacity: 0; } }
@keyframes glisse { from { transform: translateX(40px); opacity: 0; } }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 14px; border-bottom: 1px solid var(--border); }
.dr-head h2 { font-size: 22px; margin-top: 4px; }
.dr-head .x { font-size: 26px; margin: -4px -8px 0 0; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 20px; overscroll-behavior: contain; }
.dr-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--card); }
.dr-f { display: flex; flex-direction: column; gap: 8px; }
.dr-f .dr-chips { margin-top: 2px; }
.dr-f .task-line { margin-top: 0; }
.dr-nom { font-weight: 700; color: var(--title); }
.dr-cost { font-size: 14px; color: var(--muted); margin: 0; }
.dr-cost b { color: var(--title); font-weight: 800; }
.dr-piles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dr-pile, .dr-evo {
  font: inherit; text-align: left; cursor: pointer; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); display: flex; flex-direction: column; gap: 2px; transition: all .2s var(--ease);
}
.dr-pile b, .dr-evo b { font-size: 14px; color: var(--title); }
.dr-pile span, .dr-evo span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.dr-pile:hover, .dr-evo:hover { border-color: var(--border-strong); }
.dr-pile.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }
.dr-pile.on b { color: var(--tint-ink); }
.dr-evos { display: flex; flex-direction: column; gap: 8px; }
.dr-evo { position: relative; padding-right: 34px; }
.dr-evo::after { content: "→"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 700; }
.dr-evo:first-child { border-color: var(--accent); }
.dr-evo:first-child b { color: var(--tint-ink); }
.dr-evo[aria-expanded="true"]::after { content: "↓"; }
.dr-optim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 12px; background: var(--tint); font-size: 14px; color: var(--tint-ink); font-weight: 600; }
.dr-optim .input.n { width: 72px; padding: 6px 10px; display: inline-block; margin: 0 4px; }
.dr-etat { margin: 0; font-weight: 700; color: var(--title); }
.dr-etat b { font-weight: 800; }
.dr-f .actions { margin-top: 4px; }
.dr-tabs { align-self: flex-start; }
.dr-tabs button { padding: 7px 14px; font-size: 13.5px; }
.btn.link.danger { color: var(--muted); }
.btn.link.danger:hover { color: var(--title); text-decoration: underline; }

@media (max-width: 900px) {
  .tk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-tile.en_cours::after { display: none; }
}
@media (max-width: 640px) {
  .tk-tiles { gap: 10px; }
  .tk-tile { padding: 12px 14px; }
  .tk-tile b { font-size: 22px; }
  .tk-tile.a_traiter::after { display: none; }
  .tk-bar { gap: 10px; }
  .tk-search { flex-basis: 100%; }
  .tk-tri { flex: 1; }
  .tk-tri .select { flex: 1; }
  .tk-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .tk-cats::-webkit-scrollbar { display: none; }
  .tk-chip { flex: none; }
  .tk-row { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "i m m" ". v a"; gap: 8px 12px; padding: 14px; }
  .tk-row > :first-child { grid-area: i; align-self: start; margin-top: 2px; }
  .tk-main { grid-area: m; }
  .tk-val { grid-area: v; text-align: left; }
  .tk-val b, .tk-val span { display: inline; }
  .tk-val span { margin-left: 6px; }
  .tk-act { grid-area: a; }
  .tk-chev { display: none; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; border-bottom: 0; }
  @keyframes glisse { from { transform: translateY(60px); opacity: 0; } }
  .dr-head, .dr-body, .dr-foot { padding-left: 18px; padding-right: 18px; }
  .dr-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .dr-piles { grid-template-columns: 1fr; }
}
@media print { .tk-bar, .tk-cats, .tk-act, .tk-chev, .tk-foot, #panneau { display: none !important; } }
@media (min-width: 901px) { body.drawer-open .toast { left: calc((100vw - 492px) / 2); } }
@media (max-width: 640px) { .tk-tri > span { display: none; } body.drawer-open .toast { bottom: auto; top: 16px; } }

/* ---------- Tableau de bord, version Essentiel : listes groupées ---------- */
.es { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; padding-top: 18px; }
.es-head p { font-size: 13px; color: var(--muted); }
.es-head h1 { margin-top: 4px; font-size: 30px; }
.es .argos { margin: -14px 0 0; }
.es-label { margin: 0 0 8px 16px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.es-group { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.es-foot { margin: 8px 16px 0; font-size: 12.5px; color: var(--muted); }
.es-pad { padding: 16px 18px; }
.es-row { display: flex; align-items: center; gap: 14px; padding: 13px 18px; min-height: 52px; border-top: 1px solid #EFEBE2; }
.es-row:first-child, .es-barre + .es-row { border-top: 0; }
.es-txt { min-width: 0; flex: 1; }
.es-txt b { display: block; font-size: 14px; font-weight: 600; color: var(--title); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.es-txt small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 1px; }
.es-val { font-size: 14px; font-weight: 700; color: var(--title); white-space: nowrap; font-variant-numeric: tabular-nums; }
.es-val small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.es-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.es-act { flex: none; background: none; border: 0; padding: 6px 2px; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: none; }
.es-act:hover { color: var(--accent-pressed); }
.es-link { text-decoration: none; color: inherit; transition: background .15s var(--ease); }
.es-link:hover { background: #FCFBF8; color: inherit; }
.es-link.es-more { font-size: 13.5px; font-weight: 600; color: var(--accent); min-height: 46px; }
.es-chev { margin-left: auto; color: var(--border-strong); font-size: 20px; line-height: 1; }
.es-chip { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font-weight: 800; font-size: 14px; }
.es-note { padding: 0 18px 14px 68px; margin-top: -6px; font-size: 13px; color: var(--body); }
.es-row .btn { flex: none; }

.es-resume { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.es-resume > div { padding: 20px 22px; min-width: 0; }
.es-resume > div + div { border-left: 1px solid #EFEBE2; }
.es-k { display: block; font-size: 12.5px; color: var(--muted); }
.es-v { display: block; margin-top: 6px; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; color: var(--title); line-height: 1.05; white-space: nowrap; }
.es-v small { font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.es-s { margin-top: 12px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.es-meter { display: block; height: 4px; border-radius: 4px; background: var(--alt); overflow: hidden; margin: 16px 0 8px; outline: none; }
.es-meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

.es-week { padding: 0 18px 16px 68px; }
.es-days { display: flex; gap: 6px; max-width: 320px; }
.es-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; outline: none; }
.es-day > span { width: 100%; height: 30px; border-radius: 5px; background: var(--alt); display: flex; align-items: flex-end; overflow: hidden; }
.es-day i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.es-day.auj > span { box-shadow: inset 0 0 0 1.5px var(--accent); }
.es-day small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.es-day.futur { opacity: .5; }
.es-week p { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.es-week p b { color: var(--title); font-weight: 700; }

.db-spark { margin-top: -2px; min-height: 40px; }
.db-spark svg { display: block; overflow: visible; }
.db-spark .hit { cursor: crosshair; }
.db-spark-ax { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.db-bar { display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; }
.db-bar span { min-width: 4px; outline: none; transition: filter .2s; }
.db-bar span:hover, .db-bar span:focus { filter: brightness(.88); }
.seg-ok { background: var(--accent); }
.seg-cours { background: var(--swoosh); }
.seg-reste { background: var(--border-strong); }
.seg-off { background: var(--border); }
.db-sw { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.db-sw.seg-off { box-shadow: inset 0 0 0 1px var(--border-strong); }
#profil .es-pad .row { gap: 12px; }

@media (max-width: 640px) {
  .es { gap: 26px; padding-top: 4px; }
  .es-head h1 { font-size: 26px; }
  .es-resume { grid-template-columns: minmax(0, 1fr); }
  .es-resume > div + div { border-left: 0; border-top: 1px solid #EFEBE2; }
  .es-row { padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
  .es-row .btn { margin-left: 48px; }
  .es-row .es-val small { display: none; }
  .es-note { padding-left: 14px; }
  .es-week { padding-left: 14px; }
  .es-txt b { white-space: normal; }
}
@media print { .db-spark .hit { display: none; } }

/* ---------- Écrans plein écran : connexion et questionnaire ---------- */
.plein-ecran .sidebar, .plein-ecran .mtop, .plein-ecran .tabbar { display: none; }
.plein-ecran .main { margin-left: 0; padding: 48px 20px 64px; }
.plein-ecran .toast { left: 50%; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { width: 30px; height: 30px; }
.auth-brand b { display: block; font-size: 14.5px; font-weight: 800; color: var(--title); letter-spacing: -0.01em; line-height: 1.2; }
.auth-brand small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.auth { max-width: 420px; margin: 4vh auto 0; display: flex; flex-direction: column; gap: 24px; }
.auth-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font-size: 26px; }
.auth-card > p { font-size: 14px; }
.auth-card .notice { margin-top: 0; }
.auth-card .btn { align-self: stretch; }
.auth-aide { color: var(--muted); }
.auth-switch, .auth-demo { font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-switch .es-act, .auth-demo .es-act { padding: 0; font-size: 13.5px; }

.cfg { max-width: 640px; margin: 0 auto; }
.cfg-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cfg-pas { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cfg-barre { display: flex; gap: 6px; margin: 18px 0 40px; }
.cfg-barre span { flex: 1; height: 4px; border-radius: 4px; background: var(--alt); transition: background .3s var(--ease); }
.cfg-barre span.on { background: var(--accent); }
.cfg h1 { font-size: clamp(26px, 3vw, 30px); }
.cfg-intro { margin: 8px 0 24px; font-size: 15px; max-width: 540px; }
.cfg-qs { display: flex; flex-direction: column; gap: 24px; padding: 22px; }
.cfg-q { border: 0; margin: 0; padding: 0; min-width: 0; }
.cfg-q legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--title); }
.cfg-q legend small { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cfg-q .choice { font-size: 13.5px; padding: 8px 14px; }
.cfg-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; }

@media (max-width: 640px) {
  .plein-ecran .main { padding: 24px 16px 40px; }
  .auth { margin-top: 0; }
  .auth-card { padding: 22px 20px; }
  .cfg-barre { margin-bottom: 28px; }
  .cfg-qs { padding: 18px 16px; }
}

