/* ===== Contrôles : boutons, recherche, segments, puces ===== */

.Icon { display: inline-flex; width: 14px; height: 14px; flex: none; }   /* tailles paires : centrage au pixel entier */
.Icon svg { display: block; width: 100%; height: 100%; fill: currentColor; }

/* Tout élément cliquable : fond au survol, léger scale à l'appui */
.Btn, .Segmented button, .StatusPicker button, .ChipLink, .CloseBtn {
  -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--Ease);
}
/* Appui : léger scale sur tout ce qui se clique (boutons, onglets, sélecteurs, combos) */
.Btn:active { transform: scale(.98); }
.CloseBtn:active, .Segmented button:active, .StatusPicker button:active, .ChipLink:active,
.Nav a:active, .Tabs button:active, .ViewSwitch button:active, .Picker button:active,
.ComboButton:active, .MonthCell:active:not(:disabled), .Switch:active, .NetworkLink:active,
.ProfileButton:active, .FileStatus:active, .RemoveBtn:active, .MarkRead:active, .TextBtn:active { transform: scale(.95); }
.JournalPerson:active { transform: scale(.99); }   /* carte large : appui plus discret */

.Btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: var(--RadiusControl); cursor: pointer;
  background: var(--Chip); font-weight: 500; white-space: nowrap;
}
a.Btn, label.Btn { color: inherit; text-decoration: none; }
.Btn:hover { background: var(--ChipHover); }
.Btn:active { background: var(--ChipActive); }
/* Bouton icône seule : pas de fond, juste l'icône qui s'éclaircit au survol */
.Btn.IconOnly { width: 32px; padding: 0; justify-content: center; background: none; color: var(--Muted); }
.Btn.IconOnly:hover, .Btn.IconOnly:active { background: var(--Chip); color: var(--Ink); }
.Btn.IconOnly .Icon { width: 16px; height: 16px; }   /* 16 px dans 32 px : centré au pixel entier */

/* Icône du thème : soleil en sombre, lune en clair ; on bascule simplement de l'une à l'autre */
#BtnTheme { position: relative; }
#BtnTheme .ThemeIcon { position: absolute; left: 8px; top: 8px; display: none; }
#BtnTheme.IsDark .ThemeIconSun,
#BtnTheme:not(.IsDark) .ThemeIconMoon { display: inline-flex; }

/* Bouton fermer : une croix seule, sans fond, comme les autres boutons icône */
.CloseBtn {
  display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: var(--RadiusInner); background: none; cursor: pointer;
  color: var(--Muted);
}
.CloseBtn .Icon { width: 12px; height: 12px; }
.CloseBtn:hover { color: var(--Ink); background: var(--Chip); }

/* Recherche */
.Search {
  position: relative; display: flex; align-items: center;
  flex: 0 1 220px; min-width: 120px; height: 32px;
  border-radius: var(--RadiusControl); background: var(--Chip); color: var(--Muted);
  transition: background-color 160ms ease;
}
.Search:hover, .Search:focus-within { background: var(--ChipHover); }
.Search .Icon { position: absolute; left: 10px; width: 14px; height: 14px; pointer-events: none; }
.SearchInput {
  width: 100%; min-width: 0; height: 100%;
  border: 0; background: none; outline: none;
  padding: 0 12px 0 30px; color: var(--Ink);
  text-overflow: clip;
}
.SearchInput::placeholder { color: var(--Muted); }
.SearchInput::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Fondu quand le texte dépasse (classe posée par Fades.js) */
.Fade { overflow: hidden; white-space: nowrap; text-overflow: clip; }
.Fade.IsOverflowing,
.SearchInput.IsOverflowing {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent calc(100% - 8px));
          mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent calc(100% - 8px));
}

/* Segmented (phases) et sélecteur de statut */
.Segmented, .StatusPicker {
  position: relative; display: inline-flex; gap: 2px; padding: 2px;
  background: var(--Chip);
}
.Segmented, .StatusPicker { border-radius: var(--RadiusControl); }
.Segmented { height: 32px; }
.Segmented button, .StatusPicker button {
  position: relative; z-index: 1;
  border: 0; background: none; cursor: pointer; color: var(--Muted);
}
.Segmented button { padding: 0 11px; border-radius: var(--RadiusInner); font-weight: 500; }
.StatusPicker button { padding: 4px 10px; border-radius: var(--RadiusInner); font-size: 13px; }
.Segmented button:not(.IsOn):hover, .StatusPicker button:not(.IsOn):hover { color: var(--Ink); }
.Segmented button.IsOn, .StatusPicker button.IsOn { color: var(--BrandInk); }
.Pill {
  position: absolute; top: 2px; bottom: 2px; left: 0; width: 0;
  border-radius: var(--RadiusInner); background: var(--Brand);
}

/* Puces */
.Chips { display: flex; flex-wrap: wrap; gap: 6px; }
.Chip {
  max-width: 100%;
  padding: 2px 10px; border-radius: var(--RadiusInner);
  background: var(--Chip); font-size: 12px;
}
.ChipLink { border: 0; color: inherit; line-height: inherit; cursor: pointer; }
.ChipLink:hover { background: var(--ChipHover); }
.ChipHuman { font-weight: 500; }
.ChipHuman::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px;
  border-radius: 50%; background: var(--Accent); vertical-align: 1px;
}

/* Barres de progression */
/* Piste semi-transparente : reste visible quel que soit le fond (y compris au survol) */
.Bar { height: 6px; margin-top: 4px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--Ink) 11%, transparent); }
.Bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--Brand); }

textarea.Notes {
  width: 100%; min-height: 76px; padding: 8px 10px;
  border: 0; border-radius: var(--RadiusControl);
  background: var(--Chip); resize: vertical; outline: none;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
textarea.Notes:focus { background: var(--PanelSolid); box-shadow: inset 0 0 0 1px var(--Line), 0 0 0 3px color-mix(in srgb, var(--Platinum) 22%, transparent); }

/* Zones qui défilent (ScrollFades dans Helpers.js) : bord en fondu là où du contenu est caché.
   L'opacité du bord passe en douceur de 1 à 0 quand on commence ou finit de défiler. */
@property --FadeTop { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --FadeBottom { syntax: "<number>"; inherits: false; initial-value: 0; }
.ScrollFaded {
  --FadeSize: 28px;
  -webkit-mask-image: linear-gradient(to bottom,
    #000 var(--FadeFrom, 0px), rgba(0, 0, 0, calc(1 - var(--FadeTop))) var(--FadeFrom, 0px), #000 calc(var(--FadeFrom, 0px) + var(--FadeSize)),
    #000 calc(100% - var(--FadeSize)), rgba(0, 0, 0, calc(1 - var(--FadeBottom))) 100%);
          mask-image: linear-gradient(to bottom,
    #000 var(--FadeFrom, 0px), rgba(0, 0, 0, calc(1 - var(--FadeTop))) var(--FadeFrom, 0px), #000 calc(var(--FadeFrom, 0px) + var(--FadeSize)),
    #000 calc(100% - var(--FadeSize)), rgba(0, 0, 0, calc(1 - var(--FadeBottom))) 100%);
  transition: --FadeTop 200ms ease, --FadeBottom 200ms ease;
}
