/* coTask — feuille de style unique (la CSP du serveur interdit tout style en ligne).
   Charte des maquettes validées (docs/maquettes) : anthracite, graphite, brume, nuage, or, or foncé, or doux, alerte.
   Rayons 12 / 18 px, boutons pilule, police système, filet or de 56×4 px sous les titres.
   Clair d'abord ; un thème sombre se fera en redéfinissant ces variables. */

:root {
  --anthracite: #141415;
  --graphite: #45494B;
  --brume: #CCD2D5;
  --nuage: #F3F4F5;
  --or: #C19F7A;
  --or-fonce: #8C6A45;
  --or-doux: #F5EFE7;
  --alerte: #9A3B26;
  --blanc: #FFFFFF;
  --survol: #ECEDEE;
  --gris-statut: #E8ECEE;
  --filet: rgba(69, 73, 75, 0.14);
  --bord: rgba(69, 73, 75, 0.25);
  --bord-fort: rgba(69, 73, 75, 0.3);
  --ombre: 0 10px 30px -12px rgba(20, 20, 21, 0.2);
  --voile: rgba(20, 20, 21, 0.45);
  --r-12: 12px;
  --r-18: 18px;
  --police: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--nuage); color: var(--anthracite); font-family: var(--police); }
a { color: var(--or-fonce); }
a:hover { color: var(--anthracite); }
h1, h2, h3, h4, h5, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--or-fonce); outline-offset: 2px; }
::placeholder { color: #6B6F71; opacity: 1; }

.ct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ct-muted { color: var(--graphite); }
.ct-boot { margin: 0; padding: 48px 24px; text-align: center; font-size: 14px; color: var(--graphite); }

/* --- Enveloppe ---------------------------------------------------------------------------------------------- */
.ct-app { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; background: var(--nuage); color: var(--anthracite); }
.ct-topbar, .ct-fab, .ct-scrim { display: none; }

.ct-nav {
  flex: 1 1 240px; max-width: 280px; padding: 28px 16px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
}
.ct-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-12);
  color: var(--anthracite); text-decoration: none; font-size: 14px; font-weight: 500;
}
.ct-nav a:hover { background: var(--survol); color: var(--anthracite); }
.ct-nav a[aria-current='page'] { background: var(--anthracite); color: var(--blanc); }
.ct-nav a.ct-nav-sub { padding-left: 30px; font-size: 13px; }
.ct-nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-nav a.ct-brand, .ct-brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; text-decoration: none; color: var(--anthracite); border-radius: var(--r-12); }
.ct-nav a.ct-brand:hover { background: transparent; }
.ct-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--anthracite); color: var(--or); display: flex; align-items: center; justify-content: center; flex: none; }
.ct-brand-name { font-size: 17px; font-weight: 600; }
.ct-nav-group { display: flex; flex-direction: column; gap: 2px; }
.ct-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px 12px; min-height: 26px; }
.ct-nav-add {
  width: 26px; height: 26px; border-radius: 999px; border: 0; background: transparent; color: var(--graphite);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.ct-nav-add:hover { background: var(--survol); color: var(--anthracite); }
.ct-nav-empty { padding: 4px 12px; font-size: 13px; color: var(--graphite); }
.ct-nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.ct-sync {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: var(--r-12); background: transparent;
  font-size: 13px; color: var(--graphite); text-align: left;
}
.ct-sync:hover { background: var(--survol); }
.ct-sync-dot { width: 8px; height: 8px; border-radius: 999px; background: #2F6B4F; flex: none; }
.ct-sync-dot.is-busy { background: var(--or); }
.ct-sync-dot.is-off { background: var(--alerte); }

.ct-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--graphite); }
.ct-eyebrow.is-alert { color: var(--alerte); }

.ct-main {
  flex: 999 1 560px; min-width: 0; padding: 32px 40px 40px; display: flex; flex-direction: column; gap: 24px; max-width: 1120px;
}
.ct-main:focus { outline: none; }
.ct-main-wide { max-width: 1160px; }

.ct-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ct-header-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ct-title { font-size: 34px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.ct-title-sm { font-size: 28px; }
.ct-title-flag { color: var(--graphite); font-weight: 500; }
.ct-rule { width: 56px; height: 4px; border-radius: 2px; background: var(--or); }
.ct-header-note { font-size: 13px; color: var(--graphite); }
.ct-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Boutons ------------------------------------------------------------------------------------------------ */
.ct-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 500;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--anthracite);
  text-decoration: none; white-space: nowrap;
}
.ct-btn:disabled { opacity: 0.5; }
.ct-btn-gold { font-weight: 600; padding: 10px 20px; background: var(--or); border-color: var(--or); color: var(--anthracite); }
.ct-btn-gold:not(:disabled):hover { background: #B8946D; border-color: #B8946D; color: var(--anthracite); }
.ct-btn-dark { font-weight: 600; background: var(--anthracite); border-color: var(--anthracite); color: var(--blanc); }
.ct-btn-dark:not(:disabled):hover { background: #2A2B2D; color: var(--blanc); }
.ct-btn-outline { border-color: var(--bord-fort); }
.ct-btn-outline:not(:disabled):hover { background: var(--survol); color: var(--anthracite); }
.ct-btn-ghost { color: var(--graphite); }
.ct-btn-ghost:hover { background: var(--survol); }
.ct-btn-danger { font-weight: 600; background: var(--alerte); border-color: var(--alerte); color: var(--blanc); }
.ct-btn-danger-outline { color: var(--alerte); border-color: rgba(154, 59, 38, 0.45); }
.ct-btn-sm { font-size: 13px; padding: 7px 14px; }
.ct-btn-block { width: 100%; padding: 13px 20px; font-size: 15px; }
.ct-btn-add { padding: 12px 22px; }
.ct-link-btn { border: 0; background: transparent; padding: 0; font-size: 13px; font-weight: 500; color: var(--or-fonce); text-decoration: underline; text-underline-offset: 2px; }
.ct-link-btn:hover { color: var(--anthracite); }
.ct-icon-btn {
  width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent; color: var(--graphite);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none;
}
.ct-icon-btn:hover { background: var(--survol); color: var(--anthracite); }

/* --- Cartes, sections, lignes de tâche ---------------------------------------------------------------------- */
.ct-section { display: flex; flex-direction: column; gap: 10px; }
.ct-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ct-card { background: var(--blanc); border-radius: var(--r-18); }
.ct-card-dashed { border: 1px dashed rgba(140, 106, 69, 0.55); }
.ct-card-pad { padding: 18px 20px; }
.ct-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ct-card-link { font-size: 13px; font-weight: 500; }
.ct-empty { padding: 16px; font-size: 14px; color: var(--graphite); }
.ct-empty-page { padding: 0; }

.ct-task { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--filet); min-width: 0; }
.ct-task:first-child { border-top: 0; }
.ct-task-sub { padding-left: 48px; }
.ct-check-hit { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
/* Case native invisible mais active (clic, clavier, lecteurs d'écran) posée sur le carré dessiné. */
.ct-check { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ct-check:disabled { cursor: default; }
.ct-check-box {
  width: 18px; height: 18px; flex: none; border-radius: 5px; border: 1.5px solid var(--bord-fort); background: var(--blanc);
  display: inline-flex; align-items: center; justify-content: center; color: var(--blanc);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.ct-check-hit:hover .ct-check:not(:disabled) + .ct-check-box { border-color: var(--graphite); }
.ct-check:focus-visible + .ct-check-box { outline: 2px solid var(--or); outline-offset: 2px; }
.ct-check:disabled + .ct-check-box { opacity: .45; }
.ct-check-mark path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .26s cubic-bezier(.65,0,.35,1) .08s; }
.ct-check:checked + .ct-check-box { background: var(--anthracite); border-color: var(--anthracite); }
.ct-check:checked + .ct-check-box .ct-check-mark path { stroke-dashoffset: 0; }
.ct-task.is-checking .ct-check-box { animation: ct-pop .32s cubic-bezier(.3,1.6,.5,1); }
@keyframes ct-pop { 0% { transform: scale(1); } 40% { transform: scale(.82); } 100% { transform: scale(1); } }
/* Trait barré tracé de gauche à droite (et effacé de droite à gauche en décochant). */
.ct-task-title-text {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 55% / 0% 1.5px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .34s cubic-bezier(.65,0,.35,1) .12s, color .3s ease .12s;
}
.ct-task.is-done .ct-task-title-text { background-size: 100% 1.5px; }
.ct-task.is-unchecking .ct-task-title-text { transition-delay: 0s; }
/* Ligne qui vient de changer de place (cochée, décochée, désarchivée) : elle glisse en douceur, avec un reflet or. */
.ct-task.is-arrived { animation: ct-arrive .5s cubic-bezier(.2,.8,.2,1); }
@keyframes ct-arrive { from { opacity: 0; transform: translateY(-6px); background-color: var(--or-doux); } 60% { opacity: 1; background-color: var(--or-doux); } to { transform: none; background-color: transparent; } }
.ct-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ct-section-action { font-size: 12px; }
.ct-task.is-done .ct-row-archive { opacity: .7; }
.ct-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ct-task-title {
  border: 0; background: transparent; padding: 0; margin: 0; text-align: left; font-size: 15px; color: var(--anthracite);
  overflow-wrap: anywhere; border-radius: 4px; align-self: flex-start; max-width: 100%;
}
.ct-task-title:not(:disabled):hover { color: var(--or-fonce); }
.ct-task-sub .ct-task-title { font-size: 14px; }
.ct-task.is-done .ct-task-title { color: var(--graphite); }
.ct-task.is-local { opacity: 0.75; }
.ct-task-meta { display: none; font-size: 12px; color: var(--graphite); }
.ct-task-meta.is-late { color: var(--alerte); }
.ct-task-sub-line { font-size: 12px; color: var(--graphite); overflow-wrap: anywhere; }
.ct-task-when { font-size: 13px; color: var(--graphite); width: 92px; text-align: right; flex: none; }
.ct-view-project .ct-task-when, .ct-view-client .ct-task-when { width: 88px; }
.ct-task-when.is-late { color: var(--alerte); }
.ct-row-action { width: 28px; height: 28px; opacity: 0; }
.ct-task:hover .ct-row-action, .ct-row-action:focus-visible { opacity: 1; }
.ct-agent-icon { color: var(--or-fonce); display: inline-flex; flex: none; }
.ct-agent-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: none; }

.ct-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--nuage); color: var(--graphite); white-space: nowrap; flex: none; max-width: 100%;
}
.ct-chip-gold { background: var(--or-doux); color: var(--or-fonce); }
.ct-chip-alert { color: var(--alerte); }
.ct-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; flex: none; }

.ct-add { color: var(--graphite); }
.ct-add-icon { display: inline-flex; width: 18px; justify-content: center; flex: none; }
.ct-add-input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 4px 0; font-size: 15px; border-radius: 4px; }
.ct-task-sub .ct-add-input { font-size: 14px; }
.ct-project-row { text-decoration: none; color: var(--anthracite); }
.ct-project-row:hover { background: var(--nuage); color: var(--anthracite); }
.ct-project-row:first-child { border-radius: var(--r-18) var(--r-18) 0 0; }
.ct-project-row:last-child { border-radius: 0 0 var(--r-18) var(--r-18); }
.ct-project-row:only-child { border-radius: var(--r-18); }
.ct-project-name { font-size: 15px; }
.ct-older summary { font-size: 13px; color: var(--graphite); cursor: pointer; padding: 4px 2px 10px; }

/* --- Saisie rapide ------------------------------------------------------------------------------------------ */
.ct-capture { background: var(--blanc); border-radius: var(--r-18); padding: 16px 18px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 12px; }
.ct-capture-row { display: flex; gap: 12px; align-items: center; margin: 0; }
.ct-capture-input {
  flex: 1; min-width: 0; font-size: 17px; padding: 12px 14px; border-radius: var(--r-12); border: 1px solid var(--bord);
  background: var(--nuage); color: var(--anthracite);
}
.ct-understood { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--graphite); min-height: 24px; }
.ct-capture-hint { font-size: 13px; color: var(--graphite); word-spacing: 0.2em; }
.ct-capture-warnings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--alerte); }

/* --- Colonnes (projet, prestations) ------------------------------------------------------------------------- */
.ct-columns { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.ct-col-main { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ct-col-side { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ct-col-table { flex: 3 1 520px; min-width: 0; }

.ct-billing { display: flex; flex-direction: column; gap: 6px; }
.ct-big { font-size: 28px; font-weight: 600; padding: 6px 0 2px; }
.ct-billing-sub { font-size: 13px; color: var(--graphite); padding-bottom: 8px; }
.ct-billing-add { align-self: flex-start; margin-top: 8px; }
.ct-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--filet); }
.ct-line-right { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: 10px; text-align: right; font-size: 13px; }

.ct-soon { display: flex; flex-direction: column; gap: 12px; opacity: 0.6; }
.ct-soon-text { font-size: 13px; color: var(--graphite); line-height: 1.45; }
.ct-soon-block { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--filet); }
.ct-soon-label { font-size: 13px; font-weight: 500; }

.ct-segs { display: inline-flex; align-self: flex-start; background: var(--blanc); border-radius: 999px; padding: 3px; max-width: 100%; }
.ct-soon .ct-segs, .ct-segs-light { background: var(--nuage); }
.ct-seg { font-size: 13px; font-weight: 500; padding: 7px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--anthracite); white-space: nowrap; }
.ct-seg[aria-pressed='true'] { background: var(--anthracite); color: var(--blanc); }

/* --- Prestations -------------------------------------------------------------------------------------------- */
.ct-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ct-filters-end { margin-left: auto; }
.ct-table-card { padding: 6px 8px; overflow-x: auto; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ct-table th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--graphite); text-align: left;
  padding: 12px 14px; border-bottom: 1px solid rgba(69, 73, 75, 0.2); white-space: nowrap;
}
.ct-table td { padding: 13px 14px; border-bottom: 1px solid rgba(69, 73, 75, 0.12); white-space: nowrap; }
.ct-table td.ct-cell-label { white-space: normal; min-width: 180px; }
.ct-table .ct-num { text-align: right; font-variant-numeric: tabular-nums; }
.ct-table tr.is-locked { color: var(--graphite); }
.ct-table-note { padding: 12px 14px; font-size: 13px; color: var(--graphite); }
.ct-status { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.ct-status-gold { background: var(--or-doux); color: var(--or-fonce); }
.ct-status-grey { background: var(--gris-statut); color: var(--graphite); }
.ct-status-dark { background: var(--anthracite); color: var(--blanc); }
.ct-status-alert { background: #F6E9E5; color: var(--alerte); }

.ct-export { flex: 2 1 320px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--ombre); }
.ct-export-title { font-size: 18px; font-weight: 600; }
.ct-sum { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.ct-sum-muted { color: var(--graphite); }
.ct-sum-value { color: var(--anthracite); text-align: right; }
.ct-sum-total { font-size: 16px; font-weight: 600; }
.ct-sums { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--filet); }
.ct-btn-export { font-size: 15px; padding: 13px 20px; }
.ct-export-foot { font-size: 12px; color: var(--graphite); text-align: center; }
.ct-export-name { font-size: 15px; overflow-wrap: anywhere; }
.ct-task.is-cancelled .ct-export-name { color: var(--graphite); text-decoration: line-through; }

/* --- Formulaires -------------------------------------------------------------------------------------------- */
.ct-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ct-field label, .ct-lab { font-size: 13px; font-weight: 500; }
.ct-hint { font-size: 12px; color: var(--graphite); line-height: 1.4; }
.ct-input {
  font-size: 14px; padding: 10px 12px; border-radius: var(--r-12); border: 1px solid var(--bord); background: var(--nuage);
  color: var(--anthracite); width: 100%; min-width: 0; min-height: 40px;
}
textarea.ct-input { resize: vertical; line-height: 1.45; }
.ct-filters .ct-input { width: auto; }
select.ct-input { padding-right: 32px; }
.ct-input-code { font-size: 20px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; }
.ct-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ct-fieldset legend { padding: 0 0 6px; }
.ct-radio, .ct-checkline { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.ct-radio input { accent-color: var(--anthracite); margin: 0; width: 16px; height: 16px; flex: none; }
.ct-checkline.is-done span { color: var(--graphite); text-decoration: line-through; }
.ct-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.ct-form-error { font-size: 13px; color: var(--alerte); background: #F6E9E5; border-radius: var(--r-12); padding: 10px 12px; }
.ct-note { font-size: 13px; color: var(--or-fonce); background: var(--or-doux); border-radius: var(--r-12); padding: 10px 12px; line-height: 1.45; }
.ct-note strong { color: var(--anthracite); }
.ct-note-list { margin: 6px 0; padding-left: 18px; }
.ct-note-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ct-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.ct-actions-left { margin-right: auto; }
.ct-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ct-inline-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.ct-bill-total { font-size: 15px; font-weight: 600; min-height: 20px; }
.ct-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct-swatch-label { position: relative; display: inline-flex; width: 32px; height: 32px; }
.ct-swatch-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ct-swatch { width: 32px; height: 32px; border-radius: 999px; border: 3px solid var(--blanc); box-shadow: 0 0 0 1px var(--bord); }
.ct-swatch-input:checked + .ct-swatch { box-shadow: 0 0 0 2px var(--anthracite); }
.ct-swatch-input:focus-visible + .ct-swatch { outline: 2px solid var(--or-fonce); outline-offset: 3px; }
.ct-color-custom { width: 40px; height: 32px; padding: 0; border: 1px solid var(--bord); border-radius: 8px; background: var(--blanc); }
.ct-key-projects { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-12); background: var(--nuage); max-height: 180px; overflow-y: auto; }

/* --- Connexion ---------------------------------------------------------------------------------------------- */
.ct-login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ct-login-card {
  width: 100%; max-width: 400px; background: var(--blanc); border-radius: var(--r-18); padding: 28px 24px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 18px; margin: 0;
}
.ct-login-card .ct-brand { padding: 0; }
.ct-form-step { display: flex; flex-direction: column; gap: 14px; }
.ct-login-card .ct-link-btn { align-self: center; }

/* --- Compte ------------------------------------------------------------------------------------------------- */
.ct-account-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.ct-account-lines { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 240px; font-size: 14px; }
.ct-account-lines .ct-muted { font-size: 13px; line-height: 1.45; }
.ct-account-email { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.ct-newkey { display: flex; flex-direction: column; gap: 10px; }
.ct-key-value { display: block; padding: 10px 12px; border-radius: 8px; background: var(--blanc); color: var(--anthracite); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }

/* --- Notes en Markdown (rendu sûr) -------------------------------------------------------------------------- */
.ct-md { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 8px; }
.ct-md h3, .ct-md h4, .ct-md h5 { font-size: 14px; font-weight: 600; }
.ct-md ul, .ct-md ol { margin: 0; padding-left: 20px; }
.ct-md code { background: var(--nuage); border-radius: 4px; padding: 1px 4px; }
.ct-md pre { margin: 0; padding: 10px 12px; border-radius: var(--r-12); background: var(--nuage); overflow-x: auto; }
.ct-md pre code { background: transparent; padding: 0; }

/* --- Fenêtres : boîte, panneau latéral, feuille du téléphone ------------------------------------------------- */
.ct-dialog {
  border: 0; padding: 0; border-radius: var(--r-18); background: var(--blanc); color: var(--anthracite);
  width: calc(100vw - 32px); max-width: 520px; max-height: calc(100dvh - 32px); box-shadow: 0 24px 60px -20px rgba(20, 20, 21, 0.45);
  overflow: auto;
}
.ct-dialog::backdrop { background: var(--voile); }
.ct-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 0 22px; }
.ct-dialog-title { font-size: 18px; font-weight: 600; }
.ct-dialog-body { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.ct-dialog-text { font-size: 14px; line-height: 1.5; }
.ct-dialog-panel {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: 100vw; max-width: 480px; border-radius: var(--r-18) 0 0 var(--r-18);
}
.ct-panel-title { font-size: 20px; font-weight: 600; background: transparent; border-color: transparent; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); resize: none; line-height: 1.3; }
.ct-panel-title:hover, .ct-panel-title:focus { background: var(--nuage); border-color: var(--bord); }
.ct-panel-parent { font-size: 13px; color: var(--graphite); }
.ct-panel-block { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--filet); }
.ct-panel-block > .ct-btn { align-self: flex-start; }
.ct-panel-list { display: flex; flex-direction: column; gap: 8px; }
.ct-panel-list .ct-line:first-child { border-top: 0; padding-top: 0; }
.ct-panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--filet); font-size: 12px; }
.ct-notes-area { min-height: 120px; }

.ct-dialog-sheet {
  margin: auto 0 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0;
  padding: 12px 20px calc(36px + env(safe-area-inset-bottom));
}
.ct-dialog-sheet .ct-dialog-body { padding: 0; }
.ct-sheet-grip { margin: 0 auto 16px; width: 40px; height: 5px; border-radius: 3px; background: var(--brume); }
.ct-sheet-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.ct-sheet-title { font-size: 18px; font-weight: 600; }
.ct-sheet-form .ct-capture-input { flex: none; padding: 13px 14px; }
.ct-keys { display: flex; gap: 8px; }
.ct-key { font-size: 15px; font-weight: 600; min-width: 44px; height: 44px; border-radius: var(--r-12); border: 1px solid var(--bord); background: var(--blanc); color: var(--anthracite); }
.ct-key:active { background: var(--nuage); }
.ct-btn-sheet { font-size: 16px; font-weight: 600; height: 50px; }

/* --- Messages ----------------------------------------------------------------------------------------------- */
.ct-toasts {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.ct-toast { background: var(--anthracite); color: var(--blanc); font-size: 14px; padding: 10px 16px; border-radius: var(--r-12); box-shadow: var(--ombre); max-width: 100%; }
.ct-toast-warn { background: var(--or-doux); color: var(--anthracite); border: 1px solid var(--or); }
.ct-toast-error { background: var(--alerte); }

@media (min-width: 700px) {
  .ct-mobile-only { display: none !important; }
}

/* --- Téléphone (< 700 px) : maquette iPhone ------------------------------------------------------------------ */
@media (max-width: 699px) {
  .ct-desk, .ct-desk-only { display: none !important; }
  .ct-section-bare > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .ct-app { display: block; }
  .ct-topbar { display: flex; position: absolute; top: calc(env(safe-area-inset-top) + 14px); right: 12px; z-index: 5; }
  .ct-topbar .ct-brand { display: none; }
  .ct-menu-btn { width: 44px; height: 44px; color: var(--anthracite); }
  .ct-nav {
    position: fixed; z-index: 20; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); max-width: none; height: auto;
    padding: calc(env(safe-area-inset-top) + 24px) 14px calc(env(safe-area-inset-bottom) + 20px); background: var(--nuage);
    transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0.2s; box-shadow: var(--ombre);
  }
  .ct-app.is-nav-open .ct-nav { transform: none; visibility: visible; }
  .ct-app.is-nav-open .ct-scrim { display: block; position: fixed; inset: 0; z-index: 15; background: var(--voile); }
  .ct-nav a, .ct-sync { min-height: 44px; }
  .ct-nav-add { width: 44px; height: 44px; }

  .ct-main { padding: calc(env(safe-area-inset-top) + 28px) 20px calc(env(safe-area-inset-bottom) + 112px); gap: 18px; max-width: none; }
  .ct-header { align-items: flex-start; flex-direction: column; padding-right: 48px; }
  .ct-header-text { gap: 6px; }
  .ct-header-actions { padding-right: 0; margin-right: -48px; }
  .ct-title { font-size: 30px; }

  .ct-fab {
    display: inline-flex; align-items: center; justify-content: center; position: fixed; z-index: 10;
    right: 20px; bottom: calc(env(safe-area-inset-bottom) + 24px); width: 60px; height: 60px; border-radius: 999px; border: 0;
    background: var(--or); color: var(--anthracite); box-shadow: 0 12px 28px -10px rgba(20, 20, 21, 0.5);
  }

  .ct-task { gap: 12px; padding: 13px 16px; min-height: 44px; flex-wrap: wrap; }
  .ct-task-sub { padding-left: 40px; }
  .ct-check-hit { width: 44px; height: 44px; margin: -12px; }
  .ct-check-box { width: 20px; height: 20px; }
  .ct-row-archive { opacity: 1; }
  .ct-task-main { gap: 4px; flex: 1 1 60%; }
  .ct-task-title { min-height: 24px; }
  /* Zone tactile du titre étendue à toute la hauteur de la ligne (≥ 44 px), sans changer son dessin. */
  .ct-task-main { position: relative; }
  .ct-task-title::after { content: ''; position: absolute; inset: -13px 0; }
  .ct-task-meta, .ct-task-sub-line { position: relative; pointer-events: none; }
  .ct-task-sub-line a { pointer-events: auto; position: relative; z-index: 1; }
  .ct-task-meta { display: block; }
  .ct-task-agent .ct-agent-actions, .ct-export-row .ct-agent-actions { flex-basis: 100%; padding-left: 32px; }
  .ct-task-agent .ct-chip { display: none; }
  .ct-row-action { opacity: 1; width: 44px; height: 44px; margin: -8px; }
  .ct-chip { padding: 3px 9px; }

  .ct-btn, .ct-seg, .ct-input, .ct-icon-btn, .ct-add-input { min-height: 44px; }
  .ct-icon-btn { width: 44px; }
  .ct-link-btn { min-height: 44px; }
  .ct-input, .ct-capture-input, .ct-add-input { font-size: 16px; } /* iOS ne zoome pas sur un champ ≥ 16 px */
  .ct-radio, .ct-checkline { min-height: 44px; }
  .ct-swatch-label { width: 44px; height: 44px; align-items: center; justify-content: center; }
  .ct-color-custom { width: 48px; height: 44px; }
  .ct-filters .ct-input { flex: 1 1 140px; }
  .ct-filters-end { margin-left: 0; flex: 1 1 100%; }
  .ct-segs { overflow-x: auto; }
  .ct-grid-2 { grid-template-columns: 1fr; }
  .ct-export, .ct-capture { box-shadow: none; }

  .ct-dialog-panel { max-width: 100vw; border-radius: 0; }
  .ct-dialog-modal { margin: auto 0 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; max-height: calc(100dvh - 24px); }
  .ct-dialog-modal .ct-dialog-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .ct-toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .ct-nav { transition: none; }
  .ct-check-box, .ct-check-mark path, .ct-task-title-text { transition: none; }
  .ct-task.is-checking .ct-check-box, .ct-task.is-arrived { animation: none; }
}

/* Ajustements */
.ct-field > .ct-link-btn, .ct-note > .ct-link-btn { align-self: flex-start; }
.ct-note > .ct-link-btn { display: block; margin-top: 6px; }
textarea.ct-panel-title { resize: none; }
