/* Composants réutilisables. */

/* ---------------------------------------------------------------- Icônes et boutons */

.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn--secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--secondary:hover:not(:disabled),
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-text);
}

.btn--danger {
  background: var(--danger-fill);
  color: var(--on-danger);
}

.btn--small {
  min-height: 2rem;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-small);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- Navigation */

.nav,
.nav__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__group + .nav__group {
  margin-top: var(--space-4);
}

.nav__group-label {
  display: block;
  padding: 0 var(--space-3) var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-small);
  color: var(--text);
  text-decoration: none;
}

.nav__link:hover {
  background: var(--surface-2);
}

.nav__link[aria-current="page"] {
  background: var(--surface-2);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-text);
}

@media (min-width: 48.01rem) {
  .sidebar-collapsed .nav__label,
  .sidebar-collapsed .nav__group-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .sidebar-collapsed .nav__link {
    justify-content: center;
    padding: var(--space-2);
  }
}

/* ---------------------------------------------------------------- Pages et cartes */

.page {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 60rem;
  margin: 0 auto;
}

.page__title {
  font-size: var(--text-title);
  line-height: 1.2;
}

.page__title:focus {
  outline: none;
}

.card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card__title {
  margin-bottom: var(--space-4);
  font-size: var(--text-large);
  scroll-margin-top: calc(var(--topbar-height) + var(--space-4));
}

.card__title:focus {
  outline: none;
}

.subheading {
  font-size: var(--text-base);
}

.toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
}

.toc a[aria-current="true"] {
  border-color: var(--accent-text);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.stack-small {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

ul.stack-small {
  padding-left: 1.25rem;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.loading {
  padding: var(--space-6);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- Formulaires */

.fieldset {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  border: 0;
}

.fieldset legend,
.field__label {
  margin-bottom: var(--space-2);
  padding: 0;
  font-weight: 600;
}

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

.field__hint {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-small);
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2rem;
  cursor: pointer;
}

.choice input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent);
}

.color-input {
  width: 3rem;
  height: 2.5rem;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  cursor: pointer;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.swatch {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--border-strong);
  cursor: pointer;
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--text);
}

.link-sample {
  color: var(--accent-text);
  text-decoration: underline;
}

/* ---------------------------------------------------------------- Messages et bandeaux */

.notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-small);
  border-left: 4px solid currentColor;
}

.notice--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.notice--error {
  background: var(--danger-bg);
  color: var(--danger);
}

.banners:empty {
  display: none;
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.banner__text {
  flex: 1 1 16rem;
}

.banner--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.banner--error {
  background: var(--danger-bg);
  color: var(--danger);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--text-small);
  white-space: nowrap;
}

.status--demo {
  background: var(--warning-bg);
  color: var(--warning);
}

.boot-error {
  max-width: 40rem;
  margin: var(--space-6) auto;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.signed-out .topbar__actions,
.signed-out .topbar__menu,
.signed-out .sidebar {
  display: none;
}

.signed-out .layout {
  grid-template-columns: minmax(0, 1fr);
}

.sign-in {
  max-width: 32rem;
  margin: var(--space-6) auto;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sign-in > * + * {
  margin-top: var(--space-4);
}

.boot-error h1 {
  margin-bottom: var(--space-3);
  font-size: var(--text-large);
}

.boot-error p + p {
  margin-top: var(--space-4);
}

/* ---------------------------------------------------------------- Tableaux, listes, détails */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
}

.table th,
.table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table thead th {
  color: var(--text-muted);
  font-weight: 600;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.details summary {
  cursor: pointer;
}

.details[open] summary {
  margin-bottom: var(--space-3);
}

.description-list {
  display: grid;
  gap: var(--space-3);
}

.description-list div {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) 2fr;
  gap: var(--space-3);
}

.description-list dt {
  color: var(--text-muted);
}

.error-list {
  max-height: 50vh;
  overflow-y: auto;
  color: var(--danger);
}

.log {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.log__entry {
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  overflow-wrap: anywhere;
}

.pre {
  max-height: 16rem;
  margin: 0;
  padding: var(--space-3);
  overflow: auto;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: pre-wrap;
}

@media (max-width: 30rem) {
  .description-list div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ---------------------------------------------------------------- Boîtes de dialogue */

.dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-strong);
}

.dialog--wide {
  width: min(48rem, calc(100vw - 2rem));
}

/* Le corps défile, le titre et les boutons restent visibles. */
.dialog[open] {
  display: flex;
  flex-direction: column;
}

.dialog::backdrop {
  /* Valeur littérale : ::backdrop n'hérite pas toujours des variables CSS. */
  background: rgb(0 0 0 / 0.45);
}

.dialog__title {
  margin-bottom: var(--space-4);
  font-size: var(--text-large);
}

.dialog__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  overflow: auto;
  margin: 0 calc(-1 * var(--space-2));
  padding: 0 var(--space-2);
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* ---------------------------------------------------------------- Messages temporaires */

.toasts {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  max-width: calc(100vw - 2rem);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: min(26rem, 100%);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: var(--shadow-strong);
}

.toast__message {
  flex: 1;
}

.toast--success {
  border-left-color: var(--success);
}

.toast--error {
  border-left-color: var(--danger);
}

/* ---------------------------------------------------------------- Champs */

.input {
  width: 100%;
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
}

select.input {
  width: auto;
  max-width: 100%;
}

textarea.input {
  min-height: 5rem;
  resize: vertical;
}

.input--large {
  min-height: 3rem;
  font-size: var(--text-large);
}

.input--emoji {
  width: 4rem;
  text-align: center;
}

.input:user-invalid {
  border-color: var(--danger);
}

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--space-3);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.grid-2 .input,
.grid-3 .input {
  width: 100%;
}

.inline-form {
  display: flex;
  gap: var(--space-2);
}

.inline-form .input {
  flex: 1;
}

.fieldset--inline legend {
  font-weight: 400;
  color: var(--text-muted);
}

.dialog__spacer {
  flex: 1;
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 var(--space-1);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-align: center;
}

/* ---------------------------------------------------------------- Barre du haut */

.capture {
  flex: 1;
  max-width: 28rem;
  margin-left: var(--space-4);
}

.capture__input {
  min-height: 2.25rem;
  background: var(--surface-2);
}

.topbar__palette kbd {
  font-weight: 400;
}

/* ---------------------------------------------------------------- En-têtes de page et cartes */

.page__header,
.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.card__header {
  margin-bottom: var(--space-3);
}

.card__header .card__title {
  margin-bottom: 0;
}

.page__subtitle {
  margin-top: var(--space-1);
  color: var(--text-muted);
}

.today {
  display: grid;
  gap: var(--space-5);
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  align-self: flex-start;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.segmented__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.25rem;
  padding: var(--space-1) var(--space-3);
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.segmented__item[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-text);
  box-shadow: var(--shadow);
}

.count {
  min-width: 1.5rem;
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2) var(--space-3);
}

.filters .input[type="search"] {
  width: 14rem;
  max-width: 100%;
}

.filters__more summary {
  min-height: 2.5rem;
  padding: var(--space-2) 0;
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
}

.filters__more[open] summary {
  margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------- Tâches */

.task-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
}

.task:last-child {
  border-bottom: 0;
}

.task__check {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.25rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.task__body {
  flex: 1;
  min-width: 0;
}

.task__title {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.task__title:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.task--done .task__title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin-top: var(--space-1);
}

.task__meta:empty {
  display: none;
}

.task__actions {
  display: flex;
  flex: none;
  gap: var(--space-1);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--text-small);
  line-height: 1.6;
}

.chip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--chip-color, var(--border-strong));
}

.chip--overdue {
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
}

.chip--today {
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 600;
}

.chip--priority-1,
.chip--priority-2 {
  border: 1px solid currentColor;
  background: transparent;
  color: var(--accent-text);
}

.chip--priority-1 {
  font-weight: 700;
}

.subtasks {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
}

.subtask {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.subtask input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--accent);
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.category-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.choice-list {
  max-height: 55vh;
  overflow-y: auto;
  padding: 0;
  list-style: none;
}

/* ---------------------------------------------------------------- Menus (popover) */

.menu-anchor {
  display: inline-flex;
}

.menu {
  position: fixed;
  inset: auto;
  min-width: 12rem;
  margin: 0;
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-strong);
}

.menu__item {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- Phrase du jour */

.quote {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-4);
  border-left: 4px solid var(--accent);
  font-size: var(--text-large);
  line-height: 1.45;
}

.is-active .icon {
  fill: currentColor;
}

.quote-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.quote-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.quote-list__item p {
  flex: 1 1 16rem;
}

/* ---------------------------------------------------------------- Rappels */

.reminder-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  list-style: none;
}

.reminder-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.reminder-item:last-child {
  border-bottom: 0;
}

.reminder-item__main {
  flex: 1 1 14rem;
  min-width: 0;
}

.reminder-item__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.reminder-popups {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-2));
  right: var(--space-4);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(24rem, calc(100vw - 2rem));
  max-height: calc(100dvh - var(--topbar-height) - 2rem);
  overflow-y: auto;
}

.reminder-popups:empty {
  display: none;
}

.reminder-popup {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-strong);
}

.reminder-popup__label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-small);
}

.reminder-popup__title {
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.reminder-popup__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.reminder-popup__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

/* ---------------------------------------------------------------- Recherche et palette */

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 55vh;
  overflow-y: auto;
}

.search-list {
  padding: 0;
  list-style: none;
}

.search-result {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-small);
  color: var(--text);
  text-decoration: none;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--surface-2);
}

.search-result__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.palette {
  max-height: 50vh;
  margin: 0;
  overflow-y: auto;
  padding: 0;
  list-style: none;
}

.palette__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-small);
  cursor: pointer;
}

.palette__option[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent-text);
}

.palette__empty {
  padding: var(--space-2) var(--space-3);
}

/* ---------------------------------------------------------------- Cadeaux */

.gift-people {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.gift-person {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.gift-person > .card__header {
  margin-bottom: 0;
  align-items: flex-start;
}

.gift-birthday {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-1);
  color: var(--text-muted);
  font-size: var(--text-small);
}

.gift-birthday--soon {
  color: var(--warning);
  font-weight: 600;
}

.gift-person__notes,
.gift-idea__notes {
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gift-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.gift-section .card__header {
  margin-bottom: 0;
}

.gift-interests {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.gift-interest {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding-left: var(--space-3);
  border-radius: 999px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

.gift-interest .icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
}

.gift-ideas {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gift-idea {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.gift-idea:last-child {
  border-bottom: 0;
}

.gift-idea__body {
  flex: 1 1 14rem;
  min-width: 0;
}

.gift-idea__notes {
  margin-top: var(--space-1);
  font-size: var(--text-small);
}

.gift-idea--given .task__title {
  color: var(--text-muted);
  text-decoration: line-through;
}

.gift-idea__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.chip--link {
  color: var(--accent-text);
  text-decoration: none;
}

.chip--link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- Idées */

.idea-capture {
  max-width: 48rem;
}

.idea-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.idea {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.idea__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.idea__body {
  flex: 1 1 16rem;
  min-width: 0;
}

.idea__title {
  font-size: var(--text-large);
}

.idea__title:focus {
  outline: none;
}

.idea__pitch {
  margin-top: var(--space-1);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.idea--closed .task__title {
  color: var(--text-muted);
}

.idea__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.idea__bar {
  position: relative;
  width: 2.5rem;
  height: 0.375rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.idea__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: var(--accent);
}

.chip--success {
  background: var(--success-bg);
  color: var(--success);
  font-weight: 600;
}

.idea__details summary {
  width: fit-content;
  color: var(--accent-text);
  font-weight: 600;
}

/* Le contenu d'un <details> n'est pas un conteneur flex : espacement par marges. */
.idea__details[open] > * + * {
  margin-top: var(--space-4);
}

.idea__details[open] > summary {
  margin-bottom: 0;
}

.idea__rubrics {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.idea__rubrics dt {
  font-weight: 600;
}

.idea__rubrics dd,
.idea__text {
  margin: var(--space-1) 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.idea__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.idea__step--done {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ---------------------------------------------------------------- Bloc-notes */

.note-quick {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 48rem;
}

.note-quick__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.note-quick__top .input:first-child {
  flex: 1 1 16rem;
}

.note-quick .field__hint {
  margin-top: 0;
}

.note-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.note-group .card__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.note-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.note {
  border-bottom: 1px solid var(--border);
}

.note:last-child {
  border-bottom: 0;
}

.note__toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) 0;
  border: 0;
  background: none;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.note__toggle:hover .note__title {
  color: var(--accent-text);
  text-decoration: underline;
}

.note__toggle .icon {
  transition: transform var(--duration);
}

.note__toggle[aria-expanded="true"] > .icon {
  transform: rotate(90deg);
}

.note__title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.note__pin {
  display: inline-flex;
  color: var(--accent-text);
}

.note__pin .icon {
  fill: currentColor;
}

.note__panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 0 var(--space-3) calc(16px + var(--space-2));
}

.note__panel[hidden] {
  display: none;
}

.note__content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.note__footer .task__meta {
  margin-top: 0;
}

.note__actions {
  display: flex;
  flex: none;
}

/* ---------------------------------------------------------------- Paramètres et aide */

.module-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.module-toggle .muted {
  margin-left: calc(1.125rem + var(--space-2));
  font-size: var(--text-small);
}

.guide {
  display: grid;
  gap: var(--space-2) var(--space-4);
}

.guide dt {
  font-weight: 600;
}

.guide dd {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
}

@media (max-width: 48rem) {
  .task__actions {
    flex-direction: column;
  }

  .reminder-popups {
    right: var(--space-2);
    width: calc(100vw - 1rem);
  }

  .filters .input,
  .filters select.input {
    flex: 1 1 10rem;
  }
}
