/* Dashboard (lot 11): key figures, to-do list, revenue chart, activity, top clients, quotes, VAT, « Bien démarrer ».
   Desktop: chart (2/3) next to the to-do list (1/3), then the other blocks in three columns. Tablet: two columns. Phone:
   one column, to-do first. Every block but the key figures can be hidden (D183): the layout closes up, no hole. */

.yb-dash__body {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-6);
  transition: opacity var(--yb-duration) var(--yb-ease);
}

.yb-dash__body.is-reloading {
  opacity: 0.55;
}

/* « À faire » first, the chart beside it (audit UX: what to do comes before the history; three reviewers out of three). */
.yb-dash__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "todo chart";
  align-items: start;
  gap: var(--yb-space-6);
}

.yb-dash__todo { grid-area: todo; }
.yb-dash__chart { grid-area: chart; }

/* One of the two hidden: the other takes the whole width. */
.yb-dash__grid--single {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: none;
}

.yb-dash__grid--single > .yb-panel {
  grid-area: auto;
}

/* The other blocks: up to three columns sharing the width (top clients and quotes stacked in one of them), whatever
   is shown. */
.yb-dash__more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: var(--yb-space-6);
}

.yb-dash__stack {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-6);
  min-width: 0;
}

/* « Personnaliser »: the blocks as toggle chips, then reset and done. */
.yb-dash__customize {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-3) var(--yb-space-6);
  padding: var(--yb-space-4) var(--yb-space-5);
  border: 1px dashed var(--yb-border-strong);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-dash__customize-text {
  flex: 1 1 16rem;
  min-width: 0;
}

.yb-dash__customize-text p {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-dash__customize-title {
  margin: 0;
  font-size: var(--yb-text-title-3);
  line-height: var(--yb-leading-title-3);
  font-weight: var(--yb-weight-title-3);
}

.yb-dash__customize-cards {
  flex: 2 1 28rem;
  flex-wrap: wrap;
}

.yb-dash__customize-cards .mud-icon-root {
  font-size: 16px;
}

.yb-dash__customize-actions {
  display: flex;
  gap: var(--yb-space-2);
  margin-left: auto;
}

/* « 4 blocs masqués · Personnaliser » under the dashboard. */
.yb-dash__hidden {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--yb-space-1) var(--yb-space-3);
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-dash__hidden .yb-textlink {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
}

/* « À faire » keeps its own height: folded to six lines with « Tout afficher » (audit UX), it no longer scrolls inside
   a box the height of the chart, where its end and the button were out of sight. */
@media (max-width: 1279px) {
  .yb-dash__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "todo" "chart";
  }

}

@media (max-width: 767px) {
  .yb-dash__grid,
  .yb-dash__more {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--yb-space-4);
  }

  .yb-dash__stack {
    gap: var(--yb-space-4);
  }

  .yb-dash__body {
    gap: var(--yb-space-4);
  }

  /* The main action first, then the period picker (audit UX). */
  .yb-dash__new {
    order: -1;
  }

  /* The period picker takes the whole row under the greeting. */
  .yb-dash .yb-page-header__actions,
  .yb-dash__period,
  .yb-dash__period .yb-period__button {
    width: 100%;
  }

  .yb-dash__period .yb-period__button .mud-button-label {
    justify-content: space-between;
  }
}

.yb-dash__muted {
  color: var(--yb-text-muted);
}

/* ---------- Other currencies (never converted) ---------- */
.yb-dash__fx {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-1);
  margin: calc(var(--yb-space-6) * -1 + var(--yb-space-3)) 0 0;
  padding: 0 var(--yb-space-1);
  list-style: none;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-dash__fx li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-3);
}

.yb-dash__fx .mud-icon-root {
  font-size: 16px;
}

.yb-dash__fx .yb-money {
  color: var(--yb-text);
}

@media (max-width: 767px) {
  .yb-dash__fx {
    margin-top: calc(var(--yb-space-4) * -1 + var(--yb-space-2));
  }
}

/* ---------- To-do list (rows styled in components.css) ---------- */
.yb-todo__item--neutral {
  --yb-todo-fg: var(--yb-status-neutral-fg);
  --yb-todo-bg: var(--yb-status-neutral-bg);
}

.yb-todo__more {
  padding: var(--yb-space-2) var(--yb-space-4) var(--yb-space-2) calc(var(--yb-space-5) + 36px + var(--yb-space-3));
  border-bottom: 1px solid var(--yb-border);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
}

/* WCAG 2.2 target size: the small « see all » links and buttons of « À faire » are at least 24 px tall. */
.yb-todo__more a,
.yb-todo__more-button,
.yb-todo__toggle .yb-textlink {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.yb-todo__more a {
  text-decoration: none;
}

.yb-todo__more a:hover {
  text-decoration: underline;
}

/* A suggestion, not a task: quieter than the "see all" links. */
.yb-todo__more--hint {
  font-weight: var(--yb-weight-regular, 400);
}

.yb-todo__more--hint a {
  color: var(--yb-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Revenue chart ---------- */
.yb-dash__chart-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
}

.yb-revenue {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
}

.yb-revenue__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-3) var(--yb-space-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-revenue__key {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "swatch name"
    "total total"
    "trend trend";
  align-items: center;
  column-gap: var(--yb-space-2);
}

.yb-revenue__swatch {
  grid-area: swatch;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--yb-revenue-color);
}

.yb-revenue__key--invoiced { --yb-revenue-color: var(--yb-chart-invoiced); }
.yb-revenue__key--collected { --yb-revenue-color: var(--yb-chart-collected); }

/* The previous year is a line: its key is a short dashed stroke. */
.yb-revenue__key--previous .yb-revenue__swatch {
  height: 0;
  border-radius: 0;
  border-top: 2px dashed var(--yb-chart-previous);
  background: none;
}

.yb-revenue__name {
  grid-area: name;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-revenue__total {
  grid-area: total;
}

.yb-revenue__key .yb-trend {
  grid-area: trend;
  font-size: var(--yb-text-caption);
}

.yb-revenue__figure {
  margin: 0;
}

.yb-revenue__plot {
  position: relative;
  min-height: 280px;
  margin: 0 calc(var(--yb-space-2) * -1);
}

/* MudChart: series colours from the tokens, recessive grid and axes, thin bars with a rounded top. */
.yb-revenue__chart {
  width: 100%;
}

.yb-revenue__chart .mud-chart-line,
.yb-revenue__chart svg {
  overflow: visible;
}

.yb-revenue__chart text {
  fill: var(--yb-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.yb-revenue__chart .mud-charts-gridlines-yaxis path,
.yb-revenue__chart .mud-charts-gridlines-xaxis-lines path {
  stroke: var(--yb-border);
  stroke-width: 1;
  stroke-dasharray: none;
}

.yb-revenue__data {
  margin-top: var(--yb-space-2);
}

.yb-revenue__data summary {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
  min-height: 32px;
  color: var(--yb-primary);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  cursor: pointer;
}

.yb-revenue__data summary:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
  border-radius: var(--yb-radius-sm);
}

.yb-revenue__table {
  width: 100%;
  margin-top: var(--yb-space-2);
  border-collapse: collapse;
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

.yb-revenue__table th,
.yb-revenue__table td {
  padding: var(--yb-space-1) var(--yb-space-2);
  border-bottom: 1px solid var(--yb-border);
  text-align: left;
  white-space: nowrap;
}

.yb-revenue__table thead th {
  color: var(--yb-text-muted);
  font-weight: var(--yb-weight-medium);
}

.yb-revenue__table tbody th {
  font-weight: var(--yb-weight-medium);
  text-transform: capitalize;
}

.yb-revenue__table .yb-cell-amount {
  text-align: right;
}

/* The table never widens the page: on a narrow panel it scrolls inside its own box (owner, 2026-11-24). */
.yb-revenue__data .yb-table-host {
  overflow-x: auto;
}

.yb-revenue__table thead th {
  white-space: normal;
  vertical-align: bottom;
}

/* Phones: the column headers already say what is counted, so « CHF » is not repeated in every cell, and the month
   may wrap: the four columns then fit without scrolling. */
@container table (max-width: 420px) {
  .yb-revenue__table .yb-money__currency {
    display: none;
  }

  .yb-revenue__table th,
  .yb-revenue__table td {
    padding-inline: var(--yb-space-1);
  }

  .yb-revenue__table tbody th {
    white-space: normal;
  }
}

/* ---------- Recent activity ---------- */
.yb-activity {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-activity__item {
  --yb-activity-fg: var(--yb-status-blue-fg);
  --yb-activity-bg: var(--yb-status-blue-bg);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4) var(--yb-space-3) var(--yb-space-5);
}

/* A thin thread joins the events, like a timeline. */
.yb-activity__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--yb-space-3) + 30px);
  bottom: calc(var(--yb-space-3) * -1 + 2px);
  left: calc(var(--yb-space-5) + 14px);
  width: 1px;
  background: var(--yb-border);
}

.yb-activity__item--green { --yb-activity-fg: var(--yb-status-green-fg); --yb-activity-bg: var(--yb-status-green-bg); }
.yb-activity__item--amber { --yb-activity-fg: var(--yb-status-amber-fg); --yb-activity-bg: var(--yb-status-amber-bg); }
.yb-activity__item--orange { --yb-activity-fg: var(--yb-status-orange-fg); --yb-activity-bg: var(--yb-status-orange-bg); }
.yb-activity__item--bordeaux { --yb-activity-fg: var(--yb-status-bordeaux-fg); --yb-activity-bg: var(--yb-status-bordeaux-bg); }
.yb-activity__item--neutral { --yb-activity-fg: var(--yb-status-neutral-fg); --yb-activity-bg: var(--yb-status-neutral-bg); }

.yb-activity__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-activity-bg);
  color: var(--yb-activity-fg);
}

.yb-activity__icon .mud-icon-root {
  font-size: 16px;
}

.yb-activity__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-activity__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--yb-text);
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.yb-activity__title:hover {
  color: var(--yb-primary);
  text-decoration: underline;
}

.yb-activity__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--yb-space-2);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-activity__amount {
  padding-top: 2px;
  white-space: nowrap;
}

/* ---------- Top clients ---------- */
.yb-clients {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-clients__item {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-1);
}

.yb-clients__line {
  display: flex;
  align-items: baseline;
  gap: var(--yb-space-3);
}

.yb-clients__name {
  overflow: hidden;
  min-width: 0;
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.yb-clients__name:hover {
  color: var(--yb-primary);
  text-decoration: underline;
}

.yb-clients__amount {
  margin-left: auto;
  white-space: nowrap;
}

.yb-clients__bar {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-bg-sunken);
}

.yb-clients__bar > span {
  display: block;
  height: 100%;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-chart-invoiced);
}

.yb-clients__meta {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

/* ---------- Quotes ---------- */
.yb-quotes {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-3);
}

.yb-quotes__rate {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--yb-space-1) var(--yb-space-3);
}

.yb-quotes__value {
  font-variant-numeric: tabular-nums;
}

.yb-quotes__caption {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-quotes__bar {
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
  border-radius: var(--yb-radius-pill);
}

.yb-quotes__seg {
  min-width: 4px;
  background: var(--yb-quote-color);
}

.yb-quotes__seg--green { --yb-quote-color: var(--yb-status-green-fg); }
.yb-quotes__seg--violet { --yb-quote-color: var(--yb-status-violet-fg); }
.yb-quotes__seg--neutral { --yb-quote-color: var(--yb-text-disabled); }
.yb-quotes__seg--expired { --yb-quote-color: var(--yb-border-strong); }

.yb-quotes__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-1) var(--yb-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

.yb-quotes__legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
}

.yb-quotes__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yb-quote-color);
}

.yb-quotes__amount {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  padding-top: var(--yb-space-3);
  border-top: 1px solid var(--yb-border);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* ---------- VAT per period ---------- */
.yb-vat {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-vat__period {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head amount"
    "rates rates";
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
}

.yb-vat__period.is-current {
  background: var(--yb-selected);
  box-shadow: inset 3px 0 0 var(--yb-primary);
}

.yb-vat__period.is-future {
  color: var(--yb-text-muted);
}

.yb-vat__head {
  grid-area: head;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--yb-space-2);
  min-width: 0;
}

.yb-vat__name {
  font-weight: var(--yb-weight-strong);
}

.yb-vat__dates {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-vat__badge {
  padding: 0 var(--yb-space-2);
  border-radius: var(--yb-radius-pill);
  background: var(--yb-surface);
  color: var(--yb-primary);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  line-height: 20px;
}

.yb-vat__amount {
  grid-area: amount;
  justify-self: end;
  white-space: nowrap;
}

.yb-vat__amount--future {
  font-size: var(--yb-text-caption);
}

.yb-vat__rates {
  grid-area: rates;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--yb-space-3);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

.yb-vat__note,
.yb-vat__off {
  padding: var(--yb-space-3) var(--yb-space-5) var(--yb-space-4);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-vat__off {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--yb-space-2);
  padding-top: var(--yb-space-4);
  font-size: var(--yb-text-body);
  line-height: var(--yb-leading-body);
}

/* ---------- « Bien démarrer » ---------- */
.yb-start {
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-start__progress {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-accent-soft);
}

.yb-start__progress > span {
  display: block;
  height: 100%;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-accent);
  transition: width var(--yb-duration-slow) var(--yb-ease);
}

.yb-start__count {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Full: header with the progress, then the steps in two columns. */
.yb-start--full {
  overflow: hidden;
}

.yb-start__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--yb-space-3) var(--yb-space-8);
  padding: var(--yb-space-5) var(--yb-space-5) var(--yb-space-4);
}

.yb-start__title {
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-title-2);
  letter-spacing: -0.01em;
}

.yb-start__lead {
  margin-top: var(--yb-space-1);
  color: var(--yb-text-muted);
}

.yb-start__meter {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  width: min(280px, 100%);
}

.yb-start__meter .yb-start__progress {
  flex: 1;
}

.yb-start__steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--yb-border);
  background: var(--yb-border);
  list-style: none;
}

/* Seven steps: the last one spans the row so the grid has no hole. */
.yb-start__step:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.yb-start__step {
  background: var(--yb-surface);
}

.yb-start__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--yb-space-3);
  min-height: 64px;
  padding: var(--yb-space-3) var(--yb-space-4) var(--yb-space-3) var(--yb-space-5);
  color: var(--yb-text);
  text-decoration: none;
  transition: background var(--yb-duration-fast) var(--yb-ease);
}

.yb-start__link:hover {
  background: var(--yb-hover);
}

.yb-start__link:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-start__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
}

.yb-start__check .mud-icon-root {
  font-size: 20px;
}

.yb-start__step.is-next .yb-start__check {
  background: var(--yb-accent-soft);
  color: var(--yb-on-accent-soft);
  box-shadow: 0 0 0 2px var(--yb-accent);
}

.yb-start__step.is-done .yb-start__check {
  background: var(--yb-status-green-bg);
  color: var(--yb-status-green-fg);
}

.yb-start__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-start__label {
  font-weight: var(--yb-weight-medium);
}

.yb-start__step.is-done .yb-start__label {
  color: var(--yb-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--yb-border-strong);
}

.yb-start__hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-start__chevron.mud-icon-root {
  color: var(--yb-text-muted);
  font-size: 18px;
}

.yb-start__step.is-done .yb-start__chevron {
  visibility: hidden;
}

@media (max-width: 767px) {
  .yb-start__steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-start__header {
    padding: var(--yb-space-4);
  }

  .yb-start__link {
    padding-left: var(--yb-space-4);
  }
}

/* Compact: one line with the next step. */
.yb-start--compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2) var(--yb-space-4);
  padding: var(--yb-space-2) var(--yb-space-2) var(--yb-space-2) var(--yb-space-5);
}

.yb-start__compact-title {
  font-weight: var(--yb-weight-strong);
}

.yb-start--compact .yb-start__progress {
  width: 120px;
}

.yb-start__next {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
  min-height: 36px;
  margin-left: auto;
  padding: 0 var(--yb-space-3);
  border-radius: var(--yb-radius-sm);
  color: var(--yb-primary);
  font-weight: var(--yb-weight-strong);
  text-decoration: none;
}

.yb-start__next:hover {
  background: var(--yb-hover);
}

.yb-start__next .mud-icon-root {
  font-size: 18px;
}

@media (max-width: 767px) {
  .yb-start--compact {
    padding-left: var(--yb-space-4);
  }

  .yb-start__next {
    margin-left: calc(var(--yb-space-3) * -1);
  }
}

/* Done: a short confirmation, dismissible. */
.yb-start--done {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  padding: var(--yb-space-2) var(--yb-space-2) var(--yb-space-2) var(--yb-space-4);
  border-color: color-mix(in srgb, var(--yb-success) 30%, var(--yb-border));
  background: var(--yb-success-soft);
}

.yb-start__done-icon {
  display: inline-flex;
  color: var(--yb-success);
}

.yb-start__done-text {
  flex: 1;
  min-width: 0;
}

/* Bottom row on wide screens: every column reaches the same baseline (no ragged holes). */
@media (min-width: 1280px) {
  .yb-dash__more > .yb-panel,
  .yb-dash__stack {
    align-self: stretch;
  }

  .yb-dash__stack > .yb-panel:last-child {
    flex: 1;
  }
}

/* The tooltip of the chart: a small card of the application (surface, border, shadow), never cut by the plot. */
.yb-revenue__plot svg {
  overflow: visible;
}

.yb-revenue__tip-box {
  fill: var(--yb-surface-raised);
  stroke: var(--yb-border-strong);
  stroke-width: 1;
  filter: drop-shadow(0 4px 10px rgba(9, 30, 35, 0.16));
}

.yb-revenue__tip-title {
  fill: var(--yb-text-muted);
  font-size: 12px;
}

.yb-revenue__tip-value {
  fill: var(--yb-text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The previous year reads as a comparison: a dashed line over the bars. */
.yb-revenue__chart .mud-charts-line-series path {
  stroke-dasharray: 5 4;
  stroke-linecap: round;
}

.yb-vat__toolbar {
  display: flex;
  justify-content: flex-end;
  padding: var(--yb-space-3) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
}

.yb-vat__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
  background: var(--yb-bg-sunken);
  font-weight: var(--yb-weight-strong);
}

@media (prefers-reduced-motion: reduce) {
  .yb-dash__body,
  .yb-start__progress > span {
    transition: none;
  }
}

.yb-revenue__range {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

/* Phones: one month label out of two (they would touch), no range next to the chart title. */
@media (max-width: 767px) {
  .yb-revenue__chart .mud-charts-xaxis text:nth-of-type(even) {
    display: none;
  }

  .yb-revenue__range {
    display: none;
  }
}

@media (max-width: 1279px) and (min-width: 768px) {
  .yb-dash__more > .yb-panel,
  .yb-dash__stack {
    align-self: stretch;
  }

  .yb-dash__stack > .yb-panel:last-child {
    flex: 1;
  }
}

/* « Rappel automatique non envoyé » under an overdue invoice of « À faire » (lot 22b, D148): the reason, in full. */
.yb-todo__meta--warning {
  color: var(--yb-warning);
  white-space: normal;
}

/* « 3 factures à payer cette semaine », « 2 dépenses à me rembourser » (lot 28a): whole sentences, on two lines if needed. */
.yb-todo__item--payment .yb-todo__title,
.yb-todo__item--payment .yb-todo__meta {
  white-space: normal;
}

/* Lot 30 (D308): two actions side by side — « Déposer » and its menu ⋯, « Voir » and « C'est noté » —, across both rows
   of the grid (these rows have no amount). The title of a missing document is a sentence, not a link. */
.yb-todo__actions {
  grid-area: action;
  justify-self: end;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--yb-space-1);
}

.yb-todo__item:not(:has(.yb-todo__amount)) .yb-todo__actions {
  grid-row: 1 / span 2;
}

.yb-todo__item--expected .yb-todo__title:hover {
  color: var(--yb-text);
  text-decoration: none;
}

/* A file deposited from the row: green while it is sent, read and filed. */
.yb-todo__item--deposited {
  --yb-todo-fg: var(--yb-status-green-fg);
  --yb-todo-bg: var(--yb-status-green-bg);
}

.yb-todo__meta--done {
  color: var(--yb-status-green-fg);
  font-weight: var(--yb-weight-medium);
}

/* « 2 autres pièces attendues »: a button that looks like the links of « … de plus ». */
.yb-todo__more-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--yb-primary);
  font: inherit;
  cursor: pointer;
}

.yb-todo__more-button:hover {
  text-decoration: underline;
}

.yb-todo__more-button:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

/* A narrow « À faire » (beside the chart, a phone): the actions go under the sentence, at its start, so that the
   sentence keeps the width. */
.yb-todo {
  container-type: inline-size;
}

@container (max-width: 560px) {
  .yb-todo__item:has(.yb-todo__actions) {
    grid-template-areas:
      "icon text"
      "icon action";
    grid-template-columns: auto minmax(0, 1fr);
  }

  .yb-todo__item:has(.yb-todo__actions) .yb-todo__actions {
    grid-row: auto;
    justify-self: start;
    margin-top: var(--yb-space-1);
  }
}

/* ---------- « Statistiques » (lot 29, D298) ----------
   The year in three questions: the key figures (recettes, dépenses, résultat estimé) with the year before, the months
   (HTML bars, the year before in grey behind each one), where the money goes and the main suppliers side by side on a
   wide screen, then the VAT to pay. Tablet and phone: one column. */
.yb-stats__body {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-6);
  transition: opacity var(--yb-duration) var(--yb-ease);
}

.yb-stats__body.is-reloading {
  opacity: 0.55;
}

.yb-stats__headline {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
}

.yb-stats__basis {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

/* « et EUR 1’200 » under a key figure: the other currencies, never converted. */
.yb-stats__also {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

/* « 3 paiements sans pièce »: a slim line leading to the bank, an amber edge like the bank line of « À faire ». */
.yb-stats__notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2) var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-left: 3px solid var(--yb-warning);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
  color: var(--yb-text);
  text-decoration: none;
}

.yb-stats__notice:hover {
  background: var(--yb-hover);
}

.yb-stats__notice:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-stats__notice-icon.mud-icon-root {
  color: var(--yb-warning);
  font-size: 20px;
}

.yb-stats__notice-text {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--yb-space-2);
  min-width: 0;
}

.yb-stats__notice-text > span {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-stats__notice-action {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
  margin-left: auto;
  color: var(--yb-primary);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  white-space: nowrap;
}

.yb-stats__skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
}

.yb-stats__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--yb-space-6);
}

@media (min-width: 1180px) {
  .yb-stats__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

/* « Achats durables : CHF 4’200 — amortis par votre fiduciaire »: one discreet line under the categories. */
.yb-stats__durable {
  margin: var(--yb-space-4) 0 0;
  padding-top: var(--yb-space-3);
  border-top: 1px dashed var(--yb-border-strong);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
  font-variant-numeric: tabular-nums;
}

/* ---------- Months: recettes and dépenses, the year before in grey behind ---------- */
.yb-yearbars {
  --yb-yearbars-height: 220px;
  --yb-yearbars-income: var(--yb-chart-invoiced);
  --yb-yearbars-expenses: var(--yb-chart-collected);
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
}

.yb-yearbars__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-3) var(--yb-space-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-yearbars__key {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "swatch name"
    "total total";
  align-items: center;
  column-gap: var(--yb-space-2);
}

.yb-yearbars__key .yb-money {
  grid-area: total;
}

.yb-yearbars__swatch {
  grid-area: swatch;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--yb-yearbars-key);
}

.yb-yearbars__key--income { --yb-yearbars-key: var(--yb-yearbars-income); }
.yb-yearbars__key--expenses { --yb-yearbars-key: var(--yb-yearbars-expenses); }

/* The year before: the grey of the ghost bars, on its own line of the legend. */
.yb-yearbars__key--previous {
  align-self: end;
}

.yb-yearbars__key--previous .yb-yearbars__swatch {
  background: var(--yb-chart-previous);
  opacity: 0.32;
}

.yb-yearbars__name {
  grid-area: name;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-yearbars__figure {
  margin: 0;
}

.yb-yearbars__plot {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: var(--yb-yearbars-height) auto;
  column-gap: var(--yb-space-2);
}

.yb-yearbars__axis {
  position: relative;
  min-width: 2.25rem;
}

.yb-yearbars__tick {
  position: absolute;
  right: 0;
  transform: translateY(50%);
  color: var(--yb-text-muted);
  font-size: 11px;
  line-height: 1;
}

.yb-yearbars__area {
  position: relative;
  border-bottom: 1px solid var(--yb-border-strong);
}

.yb-yearbars__line {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid var(--yb-border);
}

.yb-yearbars__months,
.yb-yearbars__labels {
  display: grid;
  grid-template-columns: repeat(var(--yb-yearbars-months, 12), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-yearbars__months {
  position: absolute;
  inset: 0;
}

.yb-yearbars__month {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 0 8%;
}

/* A soft band shows which month is under the pointer. */
.yb-yearbars__month::before {
  content: "";
  position: absolute;
  inset: 0 1px;
  border-radius: var(--yb-radius-sm) var(--yb-radius-sm) 0 0;
  background: var(--yb-hover);
  opacity: 0;
  transition: opacity var(--yb-duration-fast) var(--yb-ease);
}

.yb-yearbars__month:hover::before {
  opacity: 1;
}

.yb-yearbars__pair {
  position: relative;
  flex: 1 1 0;
  max-width: 24px;
  height: 100%;
}

.yb-yearbars__ghost,
.yb-yearbars__bar {
  position: absolute;
  bottom: 0;
  border-radius: 3px 3px 0 0;
}

/* The same month a year earlier: a wider grey silhouette behind the bar of this year. */
.yb-yearbars__ghost {
  right: 0;
  left: 0;
  background: var(--yb-chart-previous);
  opacity: 0.22;
}

.yb-yearbars__bar {
  right: 20%;
  left: 20%;
  background: var(--yb-yearbars-color);
}

.yb-yearbars__pair--income { --yb-yearbars-color: var(--yb-yearbars-income); }
.yb-yearbars__pair--expenses { --yb-yearbars-color: var(--yb-yearbars-expenses); }

/* The values of the month on hover: a card at the top of the plot, turned inwards at both ends of the year. */
.yb-yearbars__tip {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  display: grid;
  gap: 2px;
  min-width: 12.5rem;
  padding: var(--yb-space-2) var(--yb-space-3);
  border: 1px solid var(--yb-border-strong);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-surface-raised);
  box-shadow: var(--yb-shadow-md);
  color: var(--yb-text);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--yb-duration-fast) var(--yb-ease), transform var(--yb-duration-fast) var(--yb-ease);
  visibility: hidden;
}

.yb-yearbars__month.is-start .yb-yearbars__tip {
  left: 0;
  transform: translate(0, 4px);
}

.yb-yearbars__month.is-end .yb-yearbars__tip {
  right: 0;
  left: auto;
  transform: translate(0, 4px);
}

.yb-yearbars__month:hover .yb-yearbars__tip {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.yb-yearbars__month.is-start:hover .yb-yearbars__tip,
.yb-yearbars__month.is-end:hover .yb-yearbars__tip {
  transform: none;
}

.yb-yearbars__tip-title {
  font-weight: var(--yb-weight-strong);
  text-transform: capitalize;
}

.yb-yearbars__tip-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  grid-template-areas:
    "dot name value"
    ". before before";
  align-items: center;
  column-gap: var(--yb-space-2);
}

.yb-yearbars__tip-row::before {
  content: "";
  grid-area: dot;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yb-yearbars-color);
}

.yb-yearbars__tip-row--income { --yb-yearbars-color: var(--yb-yearbars-income); }
.yb-yearbars__tip-row--expenses { --yb-yearbars-color: var(--yb-yearbars-expenses); }

.yb-yearbars__tip-row > span:nth-child(1) {
  grid-area: name;
  color: var(--yb-text-muted);
}

.yb-yearbars__tip-row > span:nth-child(2) {
  grid-area: value;
  font-weight: var(--yb-weight-strong);
  text-align: right;
}

.yb-yearbars__tip-before {
  grid-area: before;
  color: var(--yb-text-muted);
}

.yb-yearbars__labels {
  grid-column: 2;
  padding-top: var(--yb-space-2);
}

.yb-yearbars__labels > li {
  overflow: hidden;
  color: var(--yb-text-muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.yb-yearbars__labels > li.is-current {
  color: var(--yb-text);
  font-weight: var(--yb-weight-strong);
}

.yb-yearbars__label-short {
  display: none;
}

.yb-yearbars__note {
  margin-top: var(--yb-space-3);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-yearbars__data {
  margin-top: var(--yb-space-3);
}

.yb-yearbars__data summary {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
  min-height: 32px;
  color: var(--yb-primary);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  cursor: pointer;
}

.yb-yearbars__data summary:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
  border-radius: var(--yb-radius-sm);
}

.yb-yearbars__table {
  width: 100%;
  margin-top: var(--yb-space-2);
  border-collapse: collapse;
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

.yb-yearbars__table th,
.yb-yearbars__table td {
  padding: var(--yb-space-1) var(--yb-space-2);
  border-bottom: 1px solid var(--yb-border);
  text-align: left;
  white-space: nowrap;
}

.yb-yearbars__table thead th {
  color: var(--yb-text-muted);
  font-weight: var(--yb-weight-medium);
}

.yb-yearbars__table tbody th {
  font-weight: var(--yb-weight-medium);
  text-transform: capitalize;
}

.yb-yearbars__table tfoot th,
.yb-yearbars__table tfoot td {
  border-bottom: 0;
  font-weight: var(--yb-weight-strong);
}

.yb-yearbars__table .yb-cell-amount {
  text-align: right;
}

/* ---------- D'où vient l'argent, clients principaux, où part l'argent, fournisseurs principaux ---------- */
.yb-spend {
  display: flex;
  flex-direction: column;
  margin: calc(var(--yb-space-2) * -1) calc(var(--yb-space-3) * -1) 0;
  padding: 0;
  list-style: none;
}

.yb-spend__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 4.25rem;
  grid-template-areas:
    "name amount trend"
    "track track track";
  align-items: baseline;
  gap: var(--yb-space-2) var(--yb-space-3);
  padding: var(--yb-space-3);
  border-radius: var(--yb-radius-sm);
  color: var(--yb-text);
  text-decoration: none;
}

a.yb-spend__row:hover {
  background: var(--yb-hover);
}

a.yb-spend__row:hover .yb-spend__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.yb-spend__row:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 0;
}

.yb-spend__name {
  grid-area: name;
  overflow: hidden;
  font-weight: var(--yb-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-spend__item--others .yb-spend__name {
  color: var(--yb-text-muted);
}

.yb-spend__amount {
  grid-area: amount;
  font-weight: var(--yb-weight-strong);
  text-align: right;
  white-space: nowrap;
}

.yb-spend__trend {
  grid-area: trend;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  text-align: right;
  white-space: nowrap;
}

.yb-spend__track {
  position: relative;
  grid-area: track;
  height: 6px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-bg-sunken);
}

.yb-spend__bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  min-width: 2px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-chart-collected);
}

/* D346: « D'où vient l'argent » and « Clients principaux » in the colour of the recettes of « Mois par mois » (pétrole),
   the dépenses staying in safran. */
.yb-spend--income .yb-spend__bar,
.yb-spend--customers .yb-spend__bar {
  background: var(--yb-chart-invoiced);
}

.yb-spend__item--others .yb-spend__bar {
  background: var(--yb-border-input);
}

.yb-spend__empty {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-1);
  padding: var(--yb-space-4) 0;
}

.yb-spend__empty p {
  margin: 0;
}

.yb-spend__empty-title {
  font-weight: var(--yb-weight-medium);
}

.yb-spend__empty-hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* ---------- TVA à verser, per period ---------- */
.yb-vatpay {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--yb-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-vatpay__period {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-3);
  min-width: 0;
  padding: var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-vatpay__period.is-current {
  border-color: var(--yb-primary);
  background: var(--yb-selected);
  box-shadow: inset 0 3px 0 var(--yb-primary);
}

.yb-vatpay__period.is-future {
  background: var(--yb-bg-sunken);
}

.yb-vatpay__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--yb-space-2);
}

.yb-vatpay__name {
  font-weight: var(--yb-weight-strong);
}

.yb-vatpay__dates {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-vatpay__badge {
  padding: 0 var(--yb-space-2);
  border-radius: var(--yb-radius-pill);
  background: var(--yb-surface);
  color: var(--yb-primary);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  line-height: 20px;
}

.yb-vatpay__future {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-vatpay__rows {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
  margin: 0;
}

/* The label shrinks and wraps by parts (« TVA récupérée » / « sur vos dépenses ») so that the amount stays beside it. */
.yb-vatpay__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--yb-space-3);
}

.yb-vatpay__row dt {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  column-gap: 0.3em;
  min-width: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-vatpay__row dd {
  flex: none;
  margin: 0;
  white-space: nowrap;
}

.yb-vatpay__hint {
  flex-basis: 100%;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: 400;
}

.yb-vatpay__empty {
  margin: 0;
  padding: var(--yb-space-2) 0;
  color: var(--yb-text-muted);
}

.yb-vatpay__row--payable {
  align-items: center;
  padding-top: var(--yb-space-2);
  border-top: 1px solid var(--yb-border);
}

.yb-vatpay__row--payable dt {
  color: var(--yb-text);
  font-size: var(--yb-text-body);
  font-weight: var(--yb-weight-strong);
}

.yb-vatpay__others {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

.yb-vatpay__total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-2) var(--yb-space-3);
  margin-top: var(--yb-space-4);
  padding: var(--yb-space-3) var(--yb-space-4);
  border-radius: var(--yb-radius-md);
  background: var(--yb-bg-sunken);
  font-weight: var(--yb-weight-strong);
}

.yb-vatpay__total-value {
  display: inline-flex;
  align-items: baseline;
  gap: var(--yb-space-2);
}

.yb-vatpay__total-label {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-vatpay__note {
  margin: var(--yb-space-3) 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

@media (max-width: 767px) {
  .yb-stats__body {
    gap: var(--yb-space-4);
  }

  .yb-stats__grid {
    gap: var(--yb-space-4);
  }

  .yb-yearbars {
    --yb-yearbars-height: 180px;
  }

  .yb-yearbars__legend {
    gap: var(--yb-space-3) var(--yb-space-6);
  }

  .yb-yearbars__month {
    gap: 2px;
    padding: 0 4%;
  }

  .yb-yearbars__label-long {
    display: none;
  }

  .yb-yearbars__label-short {
    display: inline;
  }

  .yb-yearbars__tip {
    display: none;
  }

  .yb-vatpay {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-spend__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name name"
      "amount trend"
      "track track";
    gap: var(--yb-space-1) var(--yb-space-3);
  }

  .yb-spend__name {
    white-space: normal;
  }

  .yb-spend__amount {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yb-stats__body,
  .yb-yearbars__month::before,
  .yb-yearbars__tip {
    transition: none;
  }
}

/* ---------- « Mon année » on the dashboard (lot 29) ----------
   Three figures: side by side when the block has the room (alone on its row), one under the other in a column. */
.yb-myyear {
  container: myyear / inline-size;
}

.yb-myyear__figures {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--yb-space-3);
  margin: 0;
}

.yb-myyear__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--yb-space-3);
}

.yb-myyear__figure dt {
  color: var(--yb-text-muted);
  font-weight: var(--yb-weight-medium);
}

.yb-myyear__figure dd {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
}

.yb-myyear__figure--result {
  padding-top: var(--yb-space-3);
  border-top: 1px solid var(--yb-border);
}

.yb-myyear__figure--result dt {
  color: var(--yb-text);
  font-weight: var(--yb-weight-strong);
}

.yb-myyear__also {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

.yb-myyear__basis {
  margin: var(--yb-space-4) 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-myyear__empty {
  margin: 0;
  color: var(--yb-text-muted);
}

@container myyear (min-width: 640px) {
  .yb-myyear__figures {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--yb-space-6);
  }

  .yb-myyear__figure {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: var(--yb-space-1);
  }

  .yb-myyear__figure dd {
    align-items: flex-start;
  }

  .yb-myyear__figure--result {
    padding-top: 0;
    padding-left: var(--yb-space-6);
    border-top: 0;
    border-left: 1px solid var(--yb-border);
  }
}

/* Audit UX: « À faire » folded to its first six lines; « Tout afficher » only when something is hidden. */
.yb-todo--folded > li:nth-child(n+7):not(.yb-todo__toggle) {
  display: none;
}

.yb-todo__toggle {
  display: none;
  padding: var(--yb-space-3) var(--yb-space-5);
  text-align: center;
}

.yb-todo--folded:has(> li:nth-child(8)) > .yb-todo__toggle {
  display: block;
}

/* D389: the year in one sentence; the VAT to pay under the figures; three lines per list on a phone. */
.yb-stats__summary {
  margin: 0 0 var(--yb-space-3);
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-title-3, 600);
}

.yb-stats__vatcard {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: var(--yb-space-1) var(--yb-space-4);
  padding: var(--yb-space-3) var(--yb-space-5);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
  color: var(--yb-text);
  text-decoration: none;
}

.yb-stats__vatcard:hover {
  border-color: var(--yb-border-strong);
}

.yb-stats__vatcard-label {
  font-weight: var(--yb-weight-strong);
}

.yb-stats__vatcard-hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

@media (max-width: 767.98px) {
  .yb-stats__vatcard {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .yb-stats__vatcard-hint {
    grid-column: 1 / -1;
  }

  .yb-spend:not(.is-all) > .yb-spend__item:nth-child(n + 4) {
    display: none;
  }
}

.yb-spend__more {
  margin: var(--yb-space-2) var(--yb-space-5) var(--yb-space-4);
}

/* « Bien démarrer » can be hidden at any step: a quiet close button at the end of the line. */
.yb-start__hide {
  flex: none;
  color: var(--yb-text-muted);
}
