/* v141.0 — Transactions variables : lecture immédiate, actions rares discrètes. */

body.transactions-mode #variable-section {
  padding-top: 2px !important;
}

body.transactions-mode #variable-section .v141-variable-primary-action {
  margin: 4px 0 18px;
  padding: 0 2px;
}

body.transactions-mode #variable-section .v141-add-expense {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 15px;
  background: var(--ca-accent, #0a8f72);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: -.12px;
  box-shadow: 0 7px 18px rgba(19, 110, 88, .12);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 130ms ease, opacity 130ms ease, box-shadow 160ms ease;
}

body.transactions-mode #variable-section .v141-add-expense > span:first-child {
  font-size: 19px;
  line-height: 1;
  font-weight: 500;
  transform: translateY(-.5px);
}

body.transactions-mode #variable-section .v141-add-expense:active {
  transform: scale(.985);
  opacity: .90;
  box-shadow: 0 3px 10px rgba(19, 110, 88, .10);
}

body.transactions-mode #variable-section .variable-categories {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 1px solid var(--ui-border, var(--line, #e7eaee));
}

body.transactions-mode #variable-section .v141-variable-category {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ui-border, var(--line, #e7eaee)) !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  box-shadow: none !important;
}

body.transactions-mode #variable-section .v141-category-head {
  padding: 15px 2px 14px !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body.transactions-mode #variable-section .v141-category-head:focus-visible {
  border-radius: 12px !important;
  box-shadow: 0 0 0 3px rgba(24, 125, 100, .15) !important;
}

body.transactions-mode #variable-section .v141-category-topline {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 25px !important;
  gap: 12px !important;
}

body.transactions-mode #variable-section .v141-category-topline .category-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px !important;
  line-height: 1.2 !important;
  font-weight: 760 !important;
  letter-spacing: -.22px !important;
  color: var(--text) !important;
}

body.transactions-mode #variable-section .v141-category-head-right {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

body.transactions-mode #variable-section .v141-category-percent {
  min-width: 42px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

body.transactions-mode #variable-section .v141-category-percent.over,
body.transactions-mode #variable-section .v141-category-status.over {
  color: #b23a31;
}

body.transactions-mode #variable-section .v141-category-more {
  width: 26px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1;
  cursor: pointer;
  opacity: .72;
}

body.transactions-mode #variable-section .v141-variable-category.collapsed .v141-category-more {
  display: none;
}

body.transactions-mode #variable-section .v141-category-more:active { opacity: .42; }

body.transactions-mode #variable-section .v141-category-toggle {
  width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  flex: 0 0 22px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: color-mix(in srgb, var(--muted) 78%, transparent) !important;
  box-shadow: none !important;
}

body.transactions-mode #variable-section .v141-category-toggle svg {
  width: 12px !important;
  height: 12px !important;
}

body.transactions-mode #variable-section .v141-category-summary {
  margin-top: 7px;
}

body.transactions-mode #variable-section .v141-category-figures {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

body.transactions-mode #variable-section .v141-category-spent,
body.transactions-mode #variable-section .v141-category-status,
body.transactions-mode #variable-section .v141-category-budget-missing {
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  font-variant-numeric: tabular-nums;
}

body.transactions-mode #variable-section .v141-category-spent {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 620;
}

body.transactions-mode #variable-section .v141-category-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 680;
  white-space: nowrap;
}

body.transactions-mode #variable-section .v141-category-budget-missing {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ca-accent, #0a8f72) !important;
  font: inherit;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer;
}

body.transactions-mode #variable-section .v141-category-progress {
  height: 4px !important;
  margin: 8px 0 0 !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--muted) 13%, transparent) !important;
  overflow: hidden !important;
}

body.transactions-mode #variable-section .v141-category-progress .category-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--ca-accent, #0a8f72) !important;
  transition: width 220ms cubic-bezier(.2,.75,.25,1);
}

body.transactions-mode #variable-section .v141-category-progress.over .category-progress-bar {
  background: #b23a31 !important;
}

body.transactions-mode #variable-section .v141-category-list {
  padding: 0 0 8px !important;
  margin: 0 !important;
}

body.transactions-mode #variable-section .v141-category-list .plain-list {
  margin: 0 !important;
}

body.transactions-mode #variable-section .v141-category-list .swipe-content {
  min-height: 46px !important;
  padding: 7px 2px !important;
  cursor: pointer;
}

body.transactions-mode #variable-section .v141-category-list .swipe-content::after {
  left: 0 !important;
  right: 0 !important;
  background: color-mix(in srgb, var(--ui-border, var(--line, #e7eaee)) 76%, transparent) !important;
}

body.transactions-mode #variable-section .v141-category-list .line-title {
  font-size: 13px !important;
  line-height: 1.2 !important;
  font-weight: 590 !important;
  color: var(--text) !important;
}

body.transactions-mode #variable-section .v141-category-list .amount {
  font-size: 12.5px !important;
  line-height: 1 !important;
  font-weight: 710 !important;
  color: var(--text) !important;
}

body.transactions-mode #variable-section .v141-category-empty {
  padding: 9px 2px 3px !important;
  color: var(--muted) !important;
  font-size: 11.5px !important;
}

body.transactions-mode #variable-section .v141-add-category {
  width: auto;
  min-height: 40px;
  margin: 10px 0 4px;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 690;
  cursor: pointer;
  touch-action: manipulation;
}

body.transactions-mode #variable-section .v141-add-category > span:first-child {
  color: var(--ca-accent, #0a8f72);
  font-size: 16px;
  font-weight: 500;
}

body.transactions-mode #variable-section .v141-add-category:active {
  opacity: .58;
}

body.transactions-mode #variable-section .v141-variable-empty {
  padding: 24px 2px 22px;
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--ui-border, var(--line, #e7eaee));
}

body.transactions-mode #variable-section .v141-variable-empty strong {
  font-size: 13px;
  font-weight: 720;
  color: var(--text);
}

body.transactions-mode #variable-section .v141-variable-empty span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

/* Création d'une catégorie sans quitter la feuille de dépense. */
#entry-variable-new-category-fields {
  margin-top: 10px;
  padding: 11px 12px 3px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, .66fr);
  gap: 10px;
  border-radius: 13px;
  background: var(--soft);
}

#entry-variable-new-category-fields[hidden] { display: none !important; }

#entry-variable-new-category-fields .v141-inline-category-field {
  display: block;
  min-width: 0;
}

#entry-variable-new-category-fields .v141-inline-category-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

#entry-variable-new-category-fields input {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

#entry-variable-new-category-fields input:focus {
  border-color: var(--ca-accent, #0a8f72);
}

@media (max-width: 430px) {
  body.transactions-mode #variable-section .v141-add-expense { min-height: 45px; }
  body.transactions-mode #variable-section .v141-category-head { padding-left: 1px !important; padding-right: 1px !important; }
  body.transactions-mode #variable-section .v141-category-list .swipe-content { padding-left: 1px !important; padding-right: 1px !important; }
  #entry-variable-new-category-fields { grid-template-columns: 1fr; gap: 6px; }
}

/* Respect du mode UX v139 : l'ergonomie reste la même sans animation. */
html[data-motion="minimal"] body.transactions-mode #variable-section .v141-add-expense,
html[data-motion="minimal"] body.transactions-mode #variable-section .v141-category-progress .category-progress-bar {
  transition: none !important;
}


/* v142.3 — œil à la place du chevron dans les catégories variables */
body.transactions-mode #variable-section .v141-category-toggle svg {
  width: 14px !important;
  height: 14px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

body.transactions-mode #variable-section .v141-variable-category.collapsed .v141-category-toggle svg {
  transform: none !important;
}


/* v142.4 — œil plus grand, placé juste à droite du nom de catégorie */
body.transactions-mode #variable-section .v141-category-head-left {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body.transactions-mode #variable-section .v141-category-head-left .category-name {
  flex: 0 1 auto;
}

body.transactions-mode #variable-section .v141-category-toggle {
  width: 26px !important;
  height: 26px !important;
  min-height: 26px !important;
  flex: 0 0 26px !important;
  margin-left: -1px;
  color: color-mix(in srgb, var(--text) 76%, var(--muted) 24%) !important;
  opacity: .88;
}

body.transactions-mode #variable-section .v141-category-toggle svg {
  width: 16px !important;
  height: 16px !important;
}


/* v142.5 — interaction simplifiée : toute la catégorie replie/déplie, aucun œil dédié */
body.transactions-mode #variable-section .v141-category-head-left {
  gap: 0 !important;
}

body.transactions-mode #variable-section .v141-category-head-left .category-name {
  flex: 1 1 auto;
}

body.transactions-mode #variable-section .v141-category-toggle {
  display: none !important;
}


/* v142.6 — roue crantée à la place du menu à trois points */
body.transactions-mode #variable-section .v141-category-more {
  width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  flex: 0 0 30px !important;
  padding: 0 !important;
  color: color-mix(in srgb, var(--text) 68%, var(--muted) 32%) !important;
  opacity: .84 !important;
  letter-spacing: normal !important;
}

body.transactions-mode #variable-section .v141-category-more svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

body.transactions-mode #variable-section .v141-category-more:active {
  opacity: .48 !important;
  transform: scale(.92);
}


/* v142.7 — roue symétrique avec cercle central parfaitement centré */
body.transactions-mode #variable-section .v141-category-more svg circle {
  vector-effect: non-scaling-stroke;
}
