/* ==========================================================================
   Bank page (lot 19c): statements, queue to review, applied / ignored, history.
   Signature: the bank slip joined to the invoice stub by a dotted line (the
   perforation of the QR-bill), with the reason and five confidence dots.
   ========================================================================== */

/* ---------- First visit ---------- */
.yb-bank-start {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--yb-space-8);
  align-items: start;
  padding: var(--yb-space-8);
}

.yb-bank-start__title {
  margin: 0 0 var(--yb-space-2);
  font-size: var(--yb-text-title-1);
  line-height: var(--yb-leading-title-1);
  font-weight: var(--yb-weight-title-1);
  letter-spacing: var(--yb-tracking-title-1);
  text-wrap: balance;
}

.yb-bank-start__lead {
  max-width: 58ch;
  margin: 0 0 var(--yb-space-6);
  color: var(--yb-text-muted);
}

.yb-bank-steps {
  display: grid;
  gap: var(--yb-space-4);
  margin: 0 0 var(--yb-space-6);
  padding: 0;
  list-style: none;
  counter-reset: bank-step;
}

.yb-bank-steps li {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 44px;
  counter-increment: bank-step;
}

.yb-bank-steps li::before {
  content: counter(bank-step);
  position: absolute;
  top: -2px;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-primary-soft);
  color: var(--yb-on-primary-soft);
  font-weight: var(--yb-weight-strong);
  font-variant-numeric: tabular-nums;
}

.yb-bank-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: calc(-1 * var(--yb-space-4) + 2px);
  left: 13px;
  width: 2px;
  background: radial-gradient(circle, var(--yb-border-strong) 1px, transparent 1.5px) 50% 0 / 2px 6px repeat-y;
}

.yb-bank-steps strong {
  font-weight: var(--yb-weight-strong);
}

.yb-bank-steps span {
  color: var(--yb-text-muted);
}

.yb-bank-start__note {
  display: flex;
  gap: var(--yb-space-2);
  max-width: 58ch;
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-start__note .mud-icon-root {
  flex: none;
  color: var(--yb-primary);
}

.yb-bank-start__drop .yb-dropzone {
  padding-block: var(--yb-space-12);
}

.yb-bank-start__sample {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-2);
  margin-top: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4);
  border-radius: var(--yb-radius-md);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-start__readonly {
  margin: 0;
  padding: var(--yb-space-6);
  border: 1px dashed var(--yb-border-strong);
  border-radius: var(--yb-radius-md);
  color: var(--yb-text-muted);
}

/* ---------- Upload state, import result ---------- */
.yb-bank-uploading {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  margin-bottom: var(--yb-space-4);
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-uploading--error {
  border-color: color-mix(in srgb, var(--yb-error) 45%, var(--yb-border));
  background: var(--yb-error-soft);
  color: var(--yb-error);
}

.yb-bank-uploading--error > span {
  flex: 1;
}

.yb-bank-result {
  margin-bottom: var(--yb-space-4);
  padding: var(--yb-space-5);
  border: 1px solid color-mix(in srgb, var(--yb-success) 35%, var(--yb-border));
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-result__head {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-3);
}

.yb-bank-result__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-success-soft);
  color: var(--yb-success);
}

.yb-bank-result__heading {
  flex: 1;
  min-width: 0;
}

.yb-bank-result__title {
  margin: 0;
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-title-2);
}

.yb-bank-result__file {
  display: flex;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-result__counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--yb-space-4) 0 0;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-sm);
}

.yb-bank-result__count {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: var(--yb-space-3) var(--yb-space-4);
}

.yb-bank-result__count + .yb-bank-result__count {
  border-left: 1px solid var(--yb-border);
}

.yb-bank-result__count dt {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-result__count dd {
  margin: 0;
  font-size: var(--yb-text-amount-compact);
  line-height: var(--yb-leading-amount-compact);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-result__count--applied dd {
  color: var(--yb-success);
}

.yb-bank-result__count--review dd {
  color: var(--yb-on-accent-soft);
}

.yb-bank-result__paid,
.yb-bank-result__warnings {
  display: grid;
  gap: var(--yb-space-2);
  margin: var(--yb-space-4) 0 0;
  padding: 0;
  list-style: none;
}

.yb-bank-result__paid li {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--yb-space-2);
}

.yb-bank-result__paid .mud-icon-root {
  color: var(--yb-success);
}

.yb-bank-result__paid a {
  font-weight: var(--yb-weight-medium);
}

.yb-bank-result__more {
  display: block !important;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-result__warnings li {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-2);
  font-size: var(--yb-text-caption);
}

.yb-bank-result__warnings .mud-icon-root {
  flex: none;
  color: var(--yb-warning);
}

.yb-bank-result__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--yb-space-2);
}

/* ---------- Tabs, sure matches ---------- */
.yb-bank-tabs {
  margin-bottom: var(--yb-space-4);
}

.yb-bank-tabs--loading {
  display: flex;
  gap: var(--yb-space-2);
}

/* C1: the payments of one fiscal year only (from « Fin d'année » or the statistics), with « all of them » beside. */
.yb-bank-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2) var(--yb-space-3);
  margin-bottom: var(--yb-space-4);
  padding: var(--yb-space-2) var(--yb-space-3);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
  color: var(--yb-text);
}

.yb-bank-safe {
  display: flex;
  align-items: center;
  gap: var(--yb-space-4);
  margin-bottom: var(--yb-space-4);
  padding: var(--yb-space-3) var(--yb-space-4) var(--yb-space-3) var(--yb-space-3);
  border: 1px solid color-mix(in srgb, var(--yb-accent) 45%, var(--yb-border));
  border-radius: var(--yb-radius-md);
  background: var(--yb-accent-soft);
  color: var(--yb-on-accent-soft);
}

.yb-bank-safe__count {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-accent);
  color: var(--yb-on-accent);
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-safe__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.yb-bank-safe__text strong {
  color: var(--yb-text);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-safe__text span {
  font-size: var(--yb-text-caption);
}

/* ---------- Queue: split view ---------- */
.yb-bank-queue {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: var(--yb-space-4);
  outline: none;
}

.yb-bank-queue__list {
  position: sticky;
  top: calc(var(--yb-topbar-height) + var(--yb-space-4));
  max-height: calc(100dvh - var(--yb-topbar-height) - var(--yb-space-8));
  overflow-y: auto;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-queue__list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-bank-queue__list li + li {
  border-top: 1px solid var(--yb-border);
}

/* D493: in a window high enough, the queue fits it (full-page list D491, layout.css). The list and the payment shown scroll
   each on its own; the answer buttons stay at the bottom of the payment. Replaces the height computed in JavaScript
   (lot 28c, point 13). */
@media (min-width: 768px) and (min-height: 600px) {
  .yb-page--fill .yb-bank-queue {
    flex: 0 1 auto;
    grid-template-rows: minmax(0, 1fr);
    min-height: 320px;
  }

  .yb-page--fill .yb-bank-queue__list,
  .yb-page--fill .yb-bank-detail {
    /* Positioned (no longer sticky): what is placed absolutely inside (texts for screen readers) stays in the area
       that scrolls. */
    position: relative;
    top: auto;
    max-height: 100%;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .yb-page--fill .yb-bank-detail > * {
    flex-shrink: 0;
  }

  /* Stuck to the very bottom of the payment: the sticky edge is inside the padding of the area that scrolls. */
  .yb-page--fill .yb-bank-detail__actions {
    position: sticky;
    bottom: calc(-1 * var(--yb-space-5));
    z-index: 2;
    margin-inline: calc(-1 * var(--yb-space-5));
    padding: var(--yb-space-3) var(--yb-space-5);
    background: var(--yb-surface);
  }
}

/* The older payments folded, at the bottom of the list's own area (lot 28c, point 13). */
.yb-bank-queue__footer {
  padding: var(--yb-space-3) var(--yb-space-4);
  border-top: 1px solid var(--yb-border);
}

.yb-bank-queue__footer .yb-bank-older {
  margin: 0;
}

/* Nothing folded: no empty band under the last payment. */
.yb-bank-queue__footer:not(:has(*)) {
  display: none;
}

/* A sales invoice deposited in the documents among the open invoices (lot 28c). */
.yb-bank-candidate__deposited {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
}

.yb-bank-candidate__deposited .mud-icon-root {
  flex: none;
  color: var(--yb-primary);
}

.yb-bank-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 4px;
  width: 100%;
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 0;
  background: transparent;
  color: var(--yb-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-bank-row:hover {
  background: var(--yb-hover);
}

.yb-bank-row:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-bank-row.is-current {
  background: var(--yb-selected);
}

.yb-bank-row.is-current::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--yb-primary);
}

.yb-bank-row__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  min-width: 0;
}

.yb-bank-row__name {
  overflow: hidden;
  font-weight: var(--yb-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-bank-row__amount {
  flex: none;
  font-weight: var(--yb-weight-strong);
}

.yb-bank-row__meta {
  align-items: center;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-row__match {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
  min-width: 0;
}

.yb-bank-row__nomatch {
  font-style: italic;
}

/* ---------- Detail ---------- */
.yb-bank-detail {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  min-width: 0;
  padding: var(--yb-space-5);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-3);
}

.yb-bank-detail__title {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
  letter-spacing: var(--yb-tracking-caption);
  font-variant-numeric: tabular-nums;
  outline: none;
}

.yb-bank-detail__nav {
  display: inline-flex;
  gap: 2px;
}

/* The slip of the bank: amount first, then the facts. */
.yb-bank-ticket {
  padding: var(--yb-space-4) var(--yb-space-5);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-bg-sunken);
}

.yb-bank-ticket__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-2) var(--yb-space-4);
  margin-bottom: var(--yb-space-4);
}

.yb-bank-ticket__date {
  color: var(--yb-text-muted);
}

.yb-bank-ticket__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--yb-space-3) var(--yb-space-5);
  margin: 0;
}

/* The value date and the reference of the bank, folded (retouche after lot 28b). */
.yb-bank-ticket__more {
  margin-top: var(--yb-space-2);
  font-size: var(--yb-text-caption);
}

.yb-bank-ticket__facts--more {
  margin-top: var(--yb-space-2);
}

.yb-bank-ticket__fact {
  min-width: 0;
}

.yb-bank-ticket__fact--wide {
  grid-column: 1 / -1;
}

.yb-bank-ticket__fact dt {
  margin-bottom: 2px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-ticket__fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--yb-space-3);
  margin: 0;
  overflow-wrap: anywhere;
}

.yb-bank-ticket__debtor {
  font-weight: var(--yb-weight-strong);
}

.yb-bank-ticket__iban,
.yb-bank-ticket__fact--meta dd {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-ticket__reference {
  letter-spacing: 0.02em;
}

.yb-bank-ticket__none {
  color: var(--yb-text-muted);
  font-style: italic;
}

/* The dotted link between the slip and the invoice: reason and confidence. */
.yb-bank-link {
  --yb-link-color: var(--yb-border-strong);
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: calc(-1 * var(--yb-space-2)) 0;
  padding-left: 52px;
}

.yb-bank-link__rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 27px;
  width: 4px;
  background: radial-gradient(circle, var(--yb-link-color) 1.75px, transparent 2.25px) 50% 0 / 4px 8px repeat-y;
}

.yb-bank-link--high {
  --yb-link-color: var(--yb-success);
}

.yb-bank-link--medium {
  --yb-link-color: var(--yb-accent);
}

.yb-bank-link--low {
  --yb-link-color: var(--yb-text-disabled);
}

.yb-bank-link__text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-3);
  margin: 0;
  font-weight: var(--yb-weight-medium);
}

.yb-bank-link--none .yb-bank-link__text {
  color: var(--yb-text-muted);
  font-weight: var(--yb-weight-regular);
}

/* The proposed invoice: body and perforated stub, like a document card. */
.yb-bank-invoice {
  border: 1px solid var(--yb-border-strong);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-invoice__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--yb-space-3) var(--yb-space-6);
  padding: var(--yb-space-4) var(--yb-space-5);
}

.yb-bank-invoice__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.yb-bank-invoice__number {
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-strong);
  text-decoration: none;
}

.yb-bank-invoice__number:hover {
  text-decoration: underline;
}

.yb-bank-invoice__client {
  overflow-wrap: anywhere;
}

/* D356: the number or the name of the invoice proposed opens it over the bank — a button that reads like the link it was. */
.yb-bank-invoice__open {
  padding: 0;
  border: 0;
  background: none;
  color: var(--yb-primary);
  font-family: inherit;
  line-height: inherit;
  text-align: left;
  /* A button laid out in flex by the shared styles: its text starts at the left like the name under it. */
  justify-content: flex-start;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.yb-bank-invoice__open:hover {
  color: var(--yb-primary-hover);
}

/* D355: why the document is proposed, one quiet line under it (never a score). */
.yb-bank-why {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-2);
  margin: 0;
  padding: 0 var(--yb-space-1);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-why > .mud-icon-root {
  flex: none;
  margin-top: 1px;
  font-size: 1rem;
}

/* D358: a payment received citing an invoice missing from the documents, with its drop zone. */
.yb-bank-cited__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--yb-space-3);
  min-width: 0;
}

.yb-bank-cited__drop {
  background: var(--yb-surface);
}

/* D356: the window of a proposal — the payment and the document side by side, the question on top. */
.yb-bank-proposal__panel {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  padding: var(--yb-space-5);
}

.yb-bank-proposal__question {
  margin: 0;
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-proposal__panel .yb-bank-why {
  padding: 0;
  font-size: var(--yb-text-body);
}

.yb-bank-proposal__facts {
  display: grid;
  gap: var(--yb-space-3);
  margin: 0;
}

.yb-bank-proposal__fact {
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-proposal__fact dt {
  margin-bottom: var(--yb-space-1);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-proposal__fact dd {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.yb-bank-proposal__name {
  font-weight: var(--yb-weight-medium);
  overflow-wrap: anywhere;
}

.yb-bank-proposal__meta,
.yb-bank-proposal__text {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  overflow-wrap: anywhere;
}

.yb-bank-invoice__due {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  /* Wrapped under the name (a narrow detail), the amount stays on the right. */
  margin-left: auto;
}

.yb-bank-invoice__label {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-invoice__stub {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-1) var(--yb-space-4);
  padding: var(--yb-space-3) var(--yb-space-5);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  background:
    radial-gradient(circle, var(--yb-border-strong) var(--yb-perforation-dot), transparent calc(var(--yb-perforation-dot) + 0.5px)) 0 0 / var(--yb-perforation-gap) 4px repeat-x;
}

.yb-bank-invoice__after {
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
}

/* D399: several invoices or documents paid together — one line each, then their total. */
.yb-bank-group__list {
  margin: 0;
  padding: var(--yb-space-2) var(--yb-space-5) 0;
  list-style: none;
}

.yb-bank-group__item {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  min-height: 44px;
  padding: var(--yb-space-2) 0;
}

.yb-bank-group__item + .yb-bank-group__item {
  border-top: 1px solid var(--yb-border);
}

.yb-bank-group__icon {
  flex: none;
  color: var(--yb-text-muted);
}

.yb-bank-group__who {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.yb-bank-group__title {
  align-self: flex-start;
  font-weight: var(--yb-weight-strong);
  text-align: left;
}

.yb-bank-group__detail {
  overflow: hidden;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-bank-group__amount {
  flex: none;
}

.yb-bank-group__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  margin: 0 var(--yb-space-5);
  padding: var(--yb-space-3) 0 var(--yb-space-4);
  border-top: 2px solid var(--yb-border-strong);
}

/* D399: « Plusieurs factures pour ce paiement » — the choices ticked, what they make together. */
.yb-bank-many {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-1);
  margin: 0;
  padding: var(--yb-space-3) var(--yb-space-4);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-bg-sunken);
  font-size: var(--yb-text-caption);
}

.yb-bank-many__sum {
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
}

.yb-bank-many__warn {
  color: var(--yb-warning);
}

.yb-bank-candidate__tick {
  flex: none;
  color: var(--yb-primary);
}

/* D399: « +1 » beside the invoice or document of a payment that paid several together. */
.yb-bank-cell__line {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
  min-width: 0;
  max-width: 100%;
}

.yb-bank-more {
  flex: none;
  cursor: default;
}

.yb-bank-candidate.yb-bank-candidate--many {
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
}

/* Notices (overpayment, currency, reference of a closed invoice). */
.yb-bank-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-2);
  padding: var(--yb-space-3) var(--yb-space-4);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-info-soft);
  color: var(--yb-text);
}

.yb-bank-notice > .mud-icon-root {
  flex: none;
  margin-top: 2px;
  color: var(--yb-info);
}

.yb-bank-notice p {
  margin: 0;
}

.yb-bank-notice a {
  margin-left: var(--yb-space-1);
  font-weight: var(--yb-weight-medium);
}

/* The reason guessed for a payment made without document (retouche after lot 28b), shaped like the document proposed. */
.yb-bank-suggested {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon reason"
    "icon hint";
  column-gap: var(--yb-space-3);
  align-items: center;
  padding: var(--yb-space-4) var(--yb-space-5);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-bank-suggested__icon {
  grid-area: icon;
  color: var(--yb-primary);
}

.yb-bank-suggested__reason {
  grid-area: reason;
  font-size: 1.05rem;
  font-weight: var(--yb-weight-strong);
}

.yb-bank-suggested__hint {
  grid-area: hint;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* The statements in PDF waiting for the person, above the history (retouche after lot 28b). */
.yb-bank-pending {
  margin: var(--yb-space-3) var(--yb-space-4) 0;
}

.yb-bank-pending__title {
  font-weight: var(--yb-weight-medium);
}

.yb-bank-pending__list {
  margin: var(--yb-space-1) 0 0;
  padding: 0;
  list-style: none;
}

.yb-bank-pending__list li {
  padding: 2px 0;
}

.yb-bank-pending__list a {
  margin-left: 0;
}

.yb-bank-pending__why {
  color: var(--yb-text-muted);
}

.yb-bank-notice--warning {
  background: var(--yb-warning-soft);
}

.yb-bank-notice--warning > .mud-icon-root {
  color: var(--yb-warning);
}

.yb-bank-notice--error {
  background: var(--yb-error-soft);
}

.yb-bank-notice--error > .mud-icon-root {
  color: var(--yb-error);
}

.yb-bank-notice .mud-checkbox {
  margin: var(--yb-space-1) 0 0 -10px;
}

/* Manual search of an open invoice. */
.yb-bank-search {
  display: grid;
  gap: var(--yb-space-2);
}

.yb-bank-search .mud-input-control {
  margin: 0;
}

.yb-bank-search__empty {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* D484: before any search, what the list is — the invoices still open, not a proposal. */
.yb-bank-search__heading {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-search__results {
  display: grid;
  max-height: 264px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-sm);
  list-style: none;
}

.yb-bank-search__results li + li {
  border-top: 1px solid var(--yb-border);
}

/* D485: the title of the invoices already paid by hand, at the end of the list. */
.yb-bank-search__group {
  padding: var(--yb-space-2) var(--yb-space-3);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-candidate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--yb-space-3);
  width: 100%;
  min-height: 44px;
  padding: var(--yb-space-2) var(--yb-space-3);
  border: 0;
  background: transparent;
  color: var(--yb-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-bank-candidate:hover:not(:disabled) {
  background: var(--yb-hover);
}

.yb-bank-candidate:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-bank-candidate.is-selected {
  background: var(--yb-selected);
  box-shadow: inset 3px 0 0 var(--yb-primary);
}

.yb-bank-candidate:disabled {
  color: var(--yb-text-disabled);
  cursor: not-allowed;
}

.yb-bank-candidate__number {
  font-weight: var(--yb-weight-medium);
}

.yb-bank-candidate__client {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-bank-candidate__due {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* Decisions. */
.yb-bank-detail__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--yb-space-2);
  padding-top: var(--yb-space-4);
  border-top: 1px solid var(--yb-border);
}

.yb-bank-detail__error {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  margin: 0;
  color: var(--yb-error);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-bank-detail__keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--yb-space-1) var(--yb-space-4);
  margin: calc(-1 * var(--yb-space-2)) 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-detail__readonly {
  margin: 0;
  padding-top: var(--yb-space-4);
  border-top: 1px solid var(--yb-border);
  color: var(--yb-text-muted);
}

/* ---------- Applied / ignored lists, history ---------- */
.yb-bank-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-bank-cell__main {
  font-weight: var(--yb-weight-medium);
}

.yb-bank-cell__meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-cell__meta--warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--yb-warning);
}

.yb-bank-cell__dup {
  margin-left: 4px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-how {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* « Annuler » of a payment in order: on hover or focus only on a desktop (audit UX, page 10: twelve « Annuler » in a
   column read as the content of the list), always on a phone card. */
@media (hover: hover) {
  .yb-grid .mud-table-row .yb-entry-undo {
    opacity: 0;
    transition: opacity var(--yb-motion-fast, 120ms) ease;
  }

  .yb-grid .mud-table-row:hover .yb-entry-undo,
  .yb-grid .mud-table-row:focus-within .yb-entry-undo {
    opacity: 1;
  }
}

.yb-row--highlight > td {
  background: var(--yb-accent-soft) !important;
}

.yb-bank-table {
  width: 100%;
  border-collapse: collapse;
}

.yb-bank-table th {
  height: var(--yb-row-head-height);
  padding: 0 var(--yb-space-4);
  border-bottom: 1px solid var(--yb-border);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
  text-align: left;
  white-space: nowrap;
}

.yb-bank-table td {
  height: var(--yb-row-height);
  padding: var(--yb-space-2) var(--yb-space-4);
  border-bottom: 1px solid var(--yb-border);
  vertical-align: middle;
}

.yb-bank-table tr:last-child td {
  border-bottom: 0;
}

.yb-bank-table td:nth-child(2) {
  max-width: 280px;
}

.yb-bank-table .yb-cell-amount {
  text-align: right;
}

.yb-bank-todo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-accent);
  color: var(--yb-on-accent);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
}

.yb-bank-zero {
  color: var(--yb-text-disabled);
}

.yb-bank-auto .mud-switch {
  margin: 0;
}

/* On a phone the switch goes under the title, on its own line (audit UX, page 10: its label wrapped on three lines
   beside « Relevés importés »). */
@media (max-width: 767.98px) {
  .yb-bank-imports .yb-panel__header {
    flex-wrap: wrap;
  }

  .yb-bank-imports .yb-panel__actions {
    flex-basis: 100%;
  }
}

.yb-bank-auto__help {
  max-width: 80ch;
  margin: 0;
  padding: 0 var(--yb-space-5) var(--yb-space-4);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-imports {
  margin-bottom: var(--yb-space-4);
}

.yb-bank-imports .yb-table-host {
  overflow-x: auto;
}

.yb-bank-table td:nth-child(2) {
  max-width: 260px;
}

.yb-bank-table td:nth-child(2) .yb-row-link {
  display: block;
}

.yb-bank-narrow-only {
  display: none !important;
}

@container table (max-width: 720px) {
  .yb-bank-narrow-only {
    display: inline-flex !important;
  }
}

.yb-entry-list .mud-table-cell .mud-button-root {
  white-space: nowrap;
}

/* « Paiement » and « Avec » share the room left and cut their text, so that the amount and « Annuler » always show
   (a tablet in portrait). */
.yb-entry-list .mud-table-cell.yb-bank-col-flex {
  width: 50%;
  max-width: 0;
}

.yb-bank-cell > .yb-truncate {
  display: block;
  max-width: 100%;
}

/* Phone cards with a perforated stub. */
.yb-entry-cards {
  display: grid;
  gap: var(--yb-space-3);
  margin: 0;
  padding: var(--yb-space-3);
  list-style: none;
}

.yb-entry-card {
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-entry-card.is-highlight {
  border-color: var(--yb-accent);
}

.yb-entry-card__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4) 0;
}

.yb-entry-card__name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: var(--yb-weight-medium);
  overflow-wrap: anywhere;
}

.yb-entry-card__perforation {
  margin: var(--yb-space-1) var(--yb-space-3);
}

.yb-entry-card__stub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-3);
  padding: 0 var(--yb-space-4) var(--yb-space-3);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* D488: the buttons of a phone card on their own line, on the right (the box is first in the stub, before the date). */
.yb-entry-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--yb-space-1) var(--yb-space-2);
  margin-top: calc(-1 * var(--yb-space-2));
  padding: 0 var(--yb-space-3) var(--yb-space-2) var(--yb-space-4);
}


.yb-bank-drop .yb-dropzone {
  padding-block: var(--yb-space-6);
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 1279.98px) {
  .yb-bank-queue {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }

  .yb-bank-start {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--yb-space-6);
    padding: var(--yb-space-6);
  }
}

@media (max-width: 767.98px) {
  .yb-bank-start {
    padding: var(--yb-space-5) var(--yb-space-4);
  }

  .yb-bank-start__title {
    font-size: var(--yb-text-title-2);
    line-height: var(--yb-leading-title-2);
  }

  .yb-bank-queue {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-bank-queue__list {
    display: none;
  }

  .yb-bank-detail {
    padding: var(--yb-space-4);
  }

  .yb-bank-ticket {
    padding: var(--yb-space-3) var(--yb-space-4);
  }

  .yb-bank-ticket__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-bank-invoice__body,
  .yb-bank-invoice__stub {
    padding-inline: var(--yb-space-4);
  }

  .yb-bank-invoice__due {
    align-items: flex-start;
    margin-left: 0;
  }

  .yb-bank-detail__actions {
    position: sticky;
    bottom: calc(var(--yb-bottomnav-height) + env(safe-area-inset-bottom, 0px));
    z-index: 2;
    margin: 0 calc(-1 * var(--yb-space-4)) calc(-1 * var(--yb-space-4));
    padding: var(--yb-space-3) var(--yb-space-4);
    border-radius: 0 0 var(--yb-radius-md) var(--yb-radius-md);
    background: var(--yb-surface);
  }

  .yb-bank-detail__actions .mud-button-root {
    flex: 1;
    min-height: 44px;
  }

  .yb-bank-candidate {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .yb-bank-candidate__due {
    display: none;
  }

  /* « Non, une autre… » on a phone (retouche after lot 28c): the number and the amount on the first line, the whole
     name of the client under them instead of « Hôtel du L… ». */
  .yb-bank-candidate:not(.yb-bank-candidate--piece) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "number amount"
      "client client";
    row-gap: 2px;
  }

  .yb-bank-candidate:not(.yb-bank-candidate--piece) .yb-bank-candidate__number {
    grid-area: number;
  }

  .yb-bank-candidate:not(.yb-bank-candidate--piece) .yb-bank-candidate__amount {
    grid-area: amount;
  }

  .yb-bank-candidate:not(.yb-bank-candidate--piece) .yb-bank-candidate__client {
    grid-area: client;
  }

  /* The whole name, on two lines when it must (a document chosen in « Choisir parmi mes pièces » too). */
  .yb-bank-candidate__client {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .yb-bank-result__counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yb-bank-result__count:nth-child(3) {
    border-left: 0;
  }

  .yb-bank-result__count:nth-child(n + 3) {
    border-top: 1px solid var(--yb-border);
  }

  .yb-bank-safe {
    flex-wrap: wrap;
  }

  .yb-bank-safe .mud-button-root {
    width: 100%;
  }
}

/* ---------- Lot 28b: payments made and their documents ---------- */
/* The date, then what the payment expects in one sentence (on two lines at most). */
.yb-bank-row__meta {
  display: block;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.yb-bank-row__date::after {
  content: " · ";
}

.yb-bank-row__sentence.yb-bank-row__match {
  display: inline;
}

/* An invoice number never breaks at its hyphens (« F-2026-0024 »). */
.yb-bank-row__number {
  white-space: nowrap;
}

.yb-bank-row__missing {
  color: var(--yb-on-accent-soft);
  font-weight: var(--yb-weight-medium);
}

.yb-bank-link--missing {
  --yb-link-color: var(--yb-accent);
}

.yb-bank-link--missing .yb-bank-link__text {
  color: var(--yb-text);
}

.yb-bank-piece__type {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-piece__type .mud-icon-root {
  color: var(--yb-primary);
}

.yb-bank-piece .yb-bank-invoice__number {
  overflow-wrap: anywhere;
}

/* « Pièce manquante »: drop the document on the line, or say why none is needed. */
.yb-bank-missing {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--yb-space-3);
}

.yb-bank-missing__drop .yb-dropzone {
  height: 100%;
  min-height: 156px;
  padding: var(--yb-space-4);
}

.yb-bank-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--yb-space-1);
  min-height: 156px;
  padding: var(--yb-space-4);
  border: 1px solid var(--yb-border-strong);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
  color: var(--yb-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-bank-choice:hover:not(:disabled) {
  border-color: var(--yb-primary);
  background: var(--yb-hover);
}

.yb-bank-choice:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-bank-choice__icon {
  color: var(--yb-primary);
}

.yb-bank-choice__title {
  font-weight: var(--yb-weight-strong);
}

.yb-bank-choice__hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-search__other {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-2);
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-textlink {
  min-height: 32px;
  padding: 0 var(--yb-space-1);
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-primary);
  font: inherit;
  font-weight: var(--yb-weight-medium);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.yb-bank-textlink:hover {
  background: var(--yb-hover);
}

.yb-bank-textlink:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

/* « Pas besoin de pièce »: the reasons, one click each (« Autre… » asks a few words). */
.yb-bank-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-2);
}

.yb-bank-reason {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
  min-height: 44px;
  padding: 0 var(--yb-space-4);
  border: 1px solid var(--yb-border-strong);
  border-radius: 999px;
  background: var(--yb-surface);
  color: var(--yb-text);
  font: inherit;
  cursor: pointer;
}

.yb-bank-reason .mud-icon-root {
  color: var(--yb-primary);
}

.yb-bank-reason:hover:not(:disabled) {
  border-color: var(--yb-primary);
  background: var(--yb-hover);
}

.yb-bank-reason:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-bank-reason.is-selected {
  border-color: var(--yb-primary);
  background: var(--yb-selected);
}

.yb-bank-reason:disabled {
  cursor: wait;
  opacity: 0.6;
}

.yb-bank-reason-other {
  max-width: 480px;
}

.yb-bank-candidate--piece .yb-bank-candidate__type {
  display: inline-flex;
  color: var(--yb-primary);
}

/* Older payments made without document, counted apart (D261). */
.yb-bank-older {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-2);
  margin: var(--yb-space-3) 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-settled {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
  min-width: 0;
  max-width: 100%;
}

.yb-bank-settled .mud-icon-root {
  flex: none;
  color: var(--yb-primary);
}

.yb-bank-reason-tag {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-bank-result__count--money dd {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.yb-bank-result__debits {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-body);
}

@media (max-width: 767.98px) {
  .yb-bank-missing {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-bank-missing__drop .yb-dropzone,
  .yb-bank-choice {
    min-height: 0;
  }

  /* The two ways out wrap: no dot left hanging at the end of a line. */
  .yb-bank-search__dot {
    display: none;
  }

  .yb-bank-search__other {
    column-gap: var(--yb-space-4);
  }

  /* Two equal columns: a long reason (« Virement entre mes comptes ») wraps inside its tile rather than stretching it. */
  .yb-bank-reasons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yb-bank-reason {
    justify-content: flex-start;
    padding: var(--yb-space-2) var(--yb-space-3);
    border-radius: var(--yb-radius-md);
    line-height: 1.25;
    text-align: left;
  }
}

/* ---------- D340: « C'est une vente » and « Compter comme ventes (N) » in « Mis de côté » ---------- */
.yb-entry-list__toolbar {
  min-height: 52px;
}

.yb-entry-list__hint {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-entry-list .mud-table-cell.yb-cell-select {
  width: 48px;
  padding-inline: var(--yb-space-2) 0;
}

.yb-row--selected > td {
  background: var(--yb-selected);
}

.yb-entry-card__select {
  margin-inline: -6px 0;
}

/* « Ajouter ce compte dans les réglages » under an unknown account (audit UX, page 10). */
.yb-bank-unknown-add {
  font-size: var(--yb-text-caption);
}

/* An IBAN never breaks inside a group (« 9779 / 8 », audit UX, page 10). */
.yb-bank-imports .yb-bank-cell__meta.yb-num {
  white-space: nowrap;
}

/* ---------- Decisions D375–D378 (audit UX, page 10) ---------- */

/* « Oui » on a row of the queue (D375): under the amount, on the line of the sentence. */
.yb-bank-queue__item {
  position: relative;
}

.yb-bank-queue__item--yes .yb-bank-row__meta {
  padding-right: 64px;
}

.yb-bank-row__yes {
  position: absolute;
  right: var(--yb-space-3);
  bottom: var(--yb-space-2);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 28px;
  padding: 0 var(--yb-space-2);
  border: 1px solid var(--yb-primary);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-surface);
  color: var(--yb-primary);
  font: inherit;
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  cursor: pointer;
}

.yb-bank-row__yes:hover:not(:disabled) {
  background: var(--yb-primary);
  color: var(--yb-on-primary, #fff);
}

.yb-bank-row__yes:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-bank-row__yes:disabled {
  opacity: 0.5;
  cursor: default;
}

/* The phone line « 6 à vérifier · 3 à confirmer · 3 à compléter » (D375). */
.yb-bank-queue__summary {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

/* The three ways out of a missing document (D376): the drop zone, then two choices stacked beside it. */
.yb-bank-missing__choices {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--yb-space-3);
}

.yb-bank-missing__choices .yb-bank-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  column-gap: var(--yb-space-3);
  min-height: 0;
  padding: var(--yb-space-3) var(--yb-space-4);
}

.yb-bank-missing__choices .yb-bank-choice__icon {
  grid-row: span 2;
  align-self: center;
}

/* The menu of a phone card « En ordre » (D377), at the end of its stub. */
.yb-entry-card__menu {
  margin-left: auto;
}

/* A count of the statements opens its tab (D378). */
.yb-bank-count {
  padding: 0;
  border: 0;
  background: none;
  color: var(--yb-link, var(--yb-primary));
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.yb-bank-todo--link {
  border: 0;
  font: inherit;
  cursor: pointer;
}

/* « Comment obtenir mon relevé ? » under the drop zone (D378). */
.yb-bank-howto {
  margin-top: var(--yb-space-3);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-bank-howto summary {
  width: fit-content;
  color: var(--yb-link, var(--yb-primary));
  font-weight: var(--yb-weight-medium);
  cursor: pointer;
}

.yb-bank-howto ol {
  margin: var(--yb-space-2) 0;
  padding-left: var(--yb-space-5);
}

.yb-bank-howto p {
  margin: 0;
}

/* C9 of the coherence review: a payment of « Sans facture » the statistics count as a sale. */
/* D487: no margin, aligned on the left with the tag above it. */
.yb-tag--sale {
  border-style: solid;
  border-color: transparent;
  background: var(--yb-status-green-bg);
  color: var(--yb-status-green-fg);
}

/* D468: a loan keeps its contract in the documents. */
.yb-bank-reasons__hint {
  margin: var(--yb-space-2) 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

/* D487: on a phone card, the activity of a sale (« · Services de développement ») wraps inside its border instead of
   pushing the list out of the screen. */
.yb-entry-card__stub .yb-tag--sale {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: 20px;
  padding-block: 2px;
  border-radius: 10px;
  line-height: 1.3;
  white-space: normal;
}

/* D488: the tag of a sale with its activity opens « Ventes sans facture » in the settings. */
a.yb-tag--link {
  text-decoration: none;
  cursor: pointer;
}

a.yb-tag--link:hover {
  text-decoration: underline;
}

a.yb-tag--link:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

/* D488: the box of a phone card lines up with the dates of the other cards (MudBlazor's own margin set aside). */
.yb-entry-card__stub .yb-entry-card__select.mud-input-control {
  margin-inline-start: -6px;
}
