/* frontend/css/views/tasks.css — feuille Tâches (#/taches), maquette design/maquettes/C_Taches.dc.html.
   Les briques communes viennent de css/components.css : .sheet__head/.sheet__main/.sheet__foot,
   .chips/.chip, .card.tone-beurre, .eyebrow, .flag, .row/.check, .section-title, .addbar,
   .field, .chip-radio, .btn, .btn-round. Ici : ce qui est propre à la feuille, en variables
   du thème seulement (clair et sombre). Cibles tactiles >= 44 px (SPEC §3). */

/* ---------- Carte « Maintenant » (en-tête de la feuille) ---------- */

.tasks__focus:empty { display: none; }

.tfocus { gap: 0; }
.tfocus .card__title { margin-top: 0; }

/* Le titre ouvre l'édition : bouton sans habillage, texte Fraunces 24/28 coupé à 2 lignes. */
.tfocus__open {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  padding: 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.tfocus__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 28px;
}

.tfocus__meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  font-size: 13px;
  line-height: 17px;
  color: var(--mute);
}
.tfocus__meta .flag { font-size: 13px; }

.tfocus__hint {
  margin-top: 6px;
  font-size: 14px;
  line-height: 19px;
  color: var(--mute);
}

/* ---------- Liste ---------- */

.tasks__main { padding-top: 16px; }

.tgroup + .tgroup .section-title,
.tasks__none + .tgroup .section-title { margin-top: 10px; }

.tasks__none {
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 19px;
  color: var(--mute);
}

.trow { display: flex; flex-direction: column; }

/* Zone titre + ligne grise : ouvre l'édition. */
.trow__open {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  justify-content: center;
}
.trow__open .row__meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Mention « Reportée à plus tard » (tâche passée en fin de journée par « Plus tard »). */
.trow__snoozed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 15px;
  color: var(--mute);
}
.trow__snoozed svg { flex: none; }

.trow__flag {
  flex: none;
  display: inline-flex;
  color: var(--danger);
}

.trow__expand {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.trow__expand svg { transition: transform 160ms ease; }
.trow__expand[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- Sous-étapes (liste et carte « Maintenant ») ---------- */

.tsteps {
  list-style: none;
  margin: 0;
  padding: 0 0 6px 32px;
  display: flex;
  flex-direction: column;
}
.tsteps--focus {
  margin-top: 8px;
  padding: 0;
  max-height: 176px;          /* 4 étapes ; au-delà, la carte défile */
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Une étape : rond de 14 px + texte 13 px, mais une cible de 44 px de haut. */
.tstep {
  width: 100%;
  min-height: 44px;
  padding: 0 0 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 17px;
  text-align: left;
}
.tsteps--focus .tstep { padding-left: 0; }
.tstep__dot {
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 7px;
  border: 1.5px solid var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-acc);
}
.tstep__dot svg { visibility: hidden; }
.tstep__title { min-width: 0; overflow-wrap: anywhere; }
.tstep[aria-pressed="true"] { color: var(--mute); }
.tstep[aria-pressed="true"] .tstep__title { text-decoration: line-through; }
.tstep[aria-pressed="true"] .tstep__dot { background: var(--acc); border-color: var(--acc); }
.tstep[aria-pressed="true"] .tstep__dot svg { visibility: visible; }

/* ---------- Ajout rapide (pied) ---------- */

.tasks__send {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -6px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--link);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Édition ---------- */

.tedit__back {
  align-self: flex-start;
  margin: -6px 0 0 -4px;
}
.tedit__back-icon { display: inline-flex; transform: scaleX(-1); }

.tedit {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tedit__main { gap: 18px; }

.tedit__group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tedit__group > legend { padding: 0; margin-bottom: 6px; }

.tedit__cats { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }

.tedit__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--field-line);
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.tedit__checkbox {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  accent-color: var(--acc);
}
.tedit__toggle-text { flex: 1; min-width: 0; }

.tedit__due {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
.tedit__due-part { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tedit__due .field__input { padding: 0 12px; min-width: 0; }
.tedit__due-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 10px;
  margin-top: 2px;
}

.tedit__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tedit__step {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
}
.tedit__step .check { margin-left: -10px; }
.tedit__step-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 6px;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.tedit__step-input:focus { border-bottom-color: var(--acc); }
.tedit__step-input:focus-visible { outline: none; }
.tedit__step.is-done .tedit__step-input { color: var(--mute); text-decoration: line-through; }

.tedit__step-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.tedit__step-add .field__input { flex: 1; min-width: 0; }
.tedit__step-add .btn { flex: none; padding: 0 16px; }

.tedit__foot { justify-content: space-between; }
.tedit__foot .btn--primary { min-width: 140px; }
