/* Quotes, invoices and reminders (lots 7, 9, 10): lists, the document editor ("paper" edited in place), send and
   payment dialogs, the read-only document page. Tokens only (tokens.css). */

/* ---------- Small shared pieces ---------- */
.yb-textlink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--yb-primary);
  font: inherit;
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
  line-height: var(--yb-leading-caption);
  text-decoration: none;
  cursor: pointer;
}

.yb-textlink:hover {
  color: var(--yb-primary-hover);
  text-decoration: underline;
}

.yb-textlink:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.yb-textlink .mud-icon-root {
  font-size: 16px;
}

.yb-textlink--muted {
  color: var(--yb-text-muted);
}

.yb-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--yb-space-1);
}

.yb-chip {
  display: inline-block;
  height: 26px;
  line-height: 24px;
  max-width: 100%;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid var(--yb-border-strong);
  border-radius: var(--yb-radius-pill);
  background: var(--yb-surface);
  color: var(--yb-text);
  font: inherit;
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--yb-duration-fast) var(--yb-ease), border-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-chip:hover {
  border-color: var(--yb-border-input);
  background: var(--yb-hover);
}

.yb-chip:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-chip--small {
  height: 22px;
  padding: 0 8px;
  line-height: 20px;
}

.yb-chip--selected,
.yb-chip--selected:hover {
  border-color: var(--yb-text);
  background: var(--yb-text);
  color: var(--yb-bg);
}

.yb-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--yb-text);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-dialog-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.yb-dialog-title__main {
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-title-2);
  letter-spacing: var(--yb-tracking-title-2);
}

.yb-dialog-title__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--yb-space-2);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-body);
}

.yb-dialog-text {
  color: var(--yb-text-muted);
}

.yb-menu-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-6);
  width: 100%;
}

/* ---------- Lists ---------- */
.yb-page.yb-doc-list {
  width: 100%;
  min-width: 0;
}

.yb-doc-grid .mud-table-cell {
  height: var(--yb-row-height);
}

.mud-table-cell.yb-cell-docnumber {
  width: 1%;
  white-space: nowrap;
}

.yb-docnumber {
  font-weight: var(--yb-weight-medium);
}

.yb-docnumber--draft {
  color: var(--yb-text-muted);
  font-style: italic;
}

.mud-table-cell.yb-cell-client {
  max-width: 0;
  width: 40%;
}

.yb-client-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-client-cell__name,
.yb-client-cell__meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-client-cell__meta {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.mud-table-cell.yb-cell-date,
.mud-table-cell.yb-cell-status {
  width: 1%;
  white-space: nowrap;
}

.mud-table-cell.yb-cell-date {
  color: var(--yb-text-muted);
}

.yb-due--late {
  color: var(--yb-error);
  font-weight: var(--yb-weight-medium);
}

.yb-balance {
  font-weight: var(--yb-weight-medium);
}

.yb-balance--settled {
  display: inline-flex;
  color: var(--yb-success);
}

.yb-balance--settled .mud-icon-root {
  font-size: 18px;
}

.yb-row--draft .yb-money {
  color: var(--yb-text-muted);
}

.yb-row--void .yb-row-link {
  color: var(--yb-text-muted);
}

.mud-table-cell.yb-cell-actions--doc {
  width: 1%;
  padding-right: var(--yb-space-2);
  white-space: nowrap;
}

.yb-row-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

/* D372: the awaited action, written, always visible. */
.yb-row-actions__main.mud-button-root {
  margin-right: var(--yb-space-1);
  white-space: nowrap;
}

/* « rappel 2 envoyé » under « En retard +22 j ». */
.yb-cell-status__note {
  display: block;
  margin-top: 2px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
  white-space: nowrap;
}

.yb-row-actions__quick {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--yb-duration-fast) var(--yb-ease);
}

/* The quick actions float over the end of the row (status, amounts) instead of reserving an empty column: the client
   column keeps the width (names of 40 characters stay readable). The hovered row's colour fades in under them. */
@media (hover: hover) and (pointer: fine) {
  .yb-row-actions__quick {
    position: absolute;
    top: 50%;
    right: 100%;
    padding: 4px 2px 4px var(--yb-space-8);
    background: linear-gradient(var(--yb-hover), var(--yb-hover)), var(--yb-surface);
    pointer-events: none;
    transform: translateY(-50%);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--yb-space-6));
    mask-image: linear-gradient(to right, transparent, #000 var(--yb-space-6));
  }

  .yb-doc-grid .mud-table-row:hover .yb-row-actions__quick,
  .yb-doc-grid .mud-table-row:focus-within .yb-row-actions__quick {
    pointer-events: auto;
  }
}

.yb-doc-grid .mud-table-row:hover .yb-row-actions__quick,
.yb-doc-grid .mud-table-row:focus-within .yb-row-actions__quick {
  opacity: 1;
}

@media (hover: none) {
  .yb-row-actions__quick {
    display: none;
  }
}

.yb-selection-bar__hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

@media (max-width: 767px) {
  /* A wrapping column would size itself on the widest row (all the tabs): keep one column, tabs scroll inside. */
  .yb-doc-list .yb-list-toolbar {
    flex-wrap: nowrap;
  }

  .yb-doc-list .yb-list-toolbar__filters {
    max-width: 100%;
  }
}

.yb-doc-cards--list {
  margin: 0;
  padding: var(--yb-space-3);
  list-style: none;
}

/* Invoices to remind, above the list (amber: the colour of reminders). */
.yb-remind-banner {
  overflow: hidden;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-remind-banner__head {
  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-bottom: 1px solid var(--yb-border);
  background: var(--yb-status-amber-bg);
}

.yb-remind-banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-surface);
  color: var(--yb-status-amber-fg);
}

.yb-remind-banner__title {
  font-size: var(--yb-text-title-3);
  line-height: var(--yb-leading-title-3);
  font-weight: var(--yb-weight-title-3);
}

.yb-remind-banner__text {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-remind-banner__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-remind-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 9rem auto;
  align-items: center;
  gap: var(--yb-space-4);
  min-height: 48px;
  padding: var(--yb-space-2) var(--yb-space-4);
  border-bottom: 1px solid var(--yb-border);
}

.yb-remind-row:last-child {
  border-bottom: 0;
}

.yb-remind-row__name {
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
}

.yb-remind-row__name:hover {
  color: var(--yb-primary);
  text-decoration: underline;
}

.yb-remind-row__number {
  color: var(--yb-text-muted);
}

.yb-remind-row__amount {
  text-align: right;
}

/* Tablet: the number goes under the client so the name keeps a readable width ("Studio Brunner GmbH", not "Stu…");
   the chip, the amount and the action span both lines. */
@media (min-width: 768px) and (max-width: 1099px) {
  .yb-remind-row {
    grid-template-columns: minmax(0, 1fr) auto 8rem auto;
    row-gap: 0;
  }

  .yb-remind-row__name {
    grid-column: 1;
    grid-row: 1;
  }

  .yb-remind-row__number {
    grid-column: 1;
    grid-row: 2;
    font-size: var(--yb-text-caption);
  }

  .yb-remind-row > :not(.yb-remind-row__name, .yb-remind-row__number) {
    grid-row: 1 / span 2;
  }
}

@media (max-width: 767px) {
  .yb-remind-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--yb-space-1) var(--yb-space-3);
    padding: var(--yb-space-3) var(--yb-space-4);
  }

  .yb-remind-row__number {
    grid-row: 2;
  }

  .yb-remind-row__action {
    grid-column: 1 / -1;
    justify-self: start;
  }

  /* D495: one line on a phone (three cards made the list start more than a screen lower); « Voir » shows them. */
  .yb-remind-banner:not(.is-open) .yb-remind-banner__head {
    flex-wrap: nowrap;
    border-bottom: 0;
  }

  .yb-remind-banner:not(.is-open) :is(.yb-remind-banner__text, .yb-remind-banner__all, .yb-remind-banner__list) {
    display: none;
  }

  .yb-remind-banner__toggle.mud-button-root {
    margin-left: auto;
  }
}

/* D491: in a full-page list, all the invoices to remind never push the list out of the window: past four, they scroll. */
@media (min-width: 768px) and (min-height: 600px) {
  .yb-page--fill .yb-remind-banner.is-all .yb-remind-banner__list {
    position: relative;
    max-height: calc(4.5 * 49px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

/* ---------- Document editor: page, sticky bar, two columns ---------- */
.yb-page.yb-page--document {
  width: 100%;
  min-width: 0;
}

.yb-editor-page {
  --yb-editor-bar: 64px;
  container: editor / inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-5);
  min-width: 0;
}

.yb-editor-bar {
  position: sticky;
  top: var(--yb-topbar-height);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2) var(--yb-space-4);
  min-height: var(--yb-editor-bar);
  margin: calc(-1 * var(--yb-space-6)) calc(-1 * var(--yb-space-8)) 0;
  padding: var(--yb-space-3) var(--yb-space-8);
  border-bottom: 1px solid var(--yb-border);
  background: var(--yb-bg);
}

.yb-editor-bar__heading {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-editor-bar__crumbs ol {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-editor-bar__crumbs li {
  display: inline-flex;
  align-items: center;
}

.yb-editor-bar__crumbs a {
  color: var(--yb-text-muted);
  text-decoration: none;
}

.yb-editor-bar__crumbs a:hover {
  color: var(--yb-primary);
  text-decoration: underline;
}

.yb-editor-bar__title-line {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
}

.yb-editor-bar__title {
  overflow: hidden;
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-title-2);
  letter-spacing: var(--yb-tracking-title-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-editor-bar__title:focus {
  outline: none;
}

/* Read with the title (« Facture pour … · Brouillon · Enregistré »): centred on the title line, not on the bar, which
   also holds the breadcrumb above the title. */
.yb-editor-bar__status {
  display: flex;
  align-self: flex-end;
  align-items: center;
  min-width: 0;
  min-height: var(--yb-leading-title-2);
}

.yb-editor-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  margin-left: auto;
}

.yb-editor-bar__total {
  font-weight: var(--yb-weight-strong);
  white-space: nowrap;
}

.yb-editor-bar__send.mud-button-root {
  min-width: 112px;
}

/* Autosave state */
.yb-autosave {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
  white-space: nowrap;
}

.yb-autosave__icon.mud-icon-root {
  font-size: 16px;
}

.yb-autosave--saved .yb-autosave__icon {
  color: var(--yb-success);
}

.yb-autosave--saving .yb-autosave__icon,
.yb-autosave--pending .yb-autosave__icon {
  animation: yb-spin 1.2s linear infinite;
}

.yb-autosave--invalid,
.yb-autosave--conflict {
  color: var(--yb-error);
}

.yb-autosave--offline {
  color: var(--yb-warning);
}

@keyframes yb-spin {
  to {
    transform: rotate(360deg);
  }
}

.yb-editor-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
}

.yb-editor-alert--warning {
  border-color: transparent;
  background: var(--yb-warning-soft);
  color: var(--yb-text);
}

.yb-editor-alert--warning > .mud-icon-root {
  color: var(--yb-warning);
}

.yb-editor-alert > span {
  flex: 1;
  min-width: 14rem;
}

.yb-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--yb-space-6);
}

.yb-editor__doc {
  min-width: 0;
}

.yb-editor__aside {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  min-width: 0;
}

.yb-editor__preview .yb-pdf {
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  overflow: hidden;
}

.yb-editor__preview-sync {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-editor__preview-sync .mud-icon-root {
  font-size: 14px;
  animation: yb-spin 1.2s linear infinite;
}

/* Wide: the paper and, beside it, a sticky column with the totals, the readiness and the live preview. */
@container editor (min-width: 1060px) {
  .yb-editor {
    grid-template-columns: minmax(0, 1fr) clamp(340px, 34%, 520px);
  }

  .yb-editor__aside {
    position: sticky;
    top: calc(var(--yb-topbar-height) + var(--yb-editor-bar) + var(--yb-space-4));
    max-height: calc(100dvh - var(--yb-topbar-height) - var(--yb-editor-bar) - var(--yb-space-8));
    overflow: hidden auto;
    scrollbar-width: thin;
    /* The room of the scrollbar is always kept: otherwise its coming and going changes the width of the fitted
       preview, hence its height, hence whether the scrollbar is needed — an endless resize that also closed the
       browser's suggestion lists (unit of a line) while it ran. */
    scrollbar-gutter: stable;
  }

  .yb-narrow-only {
    display: none !important;
  }
}

/* Narrow: one column; "Éditer | Aperçu" switches between the paper and the preview. */
@container editor (max-width: 1059.98px) {
  .yb-wide-only {
    display: none !important;
  }

  /* Whether the document can leave sits above the paper, next to « Envoyer » (audit UX), not ten screens below. */
  .yb-editor__aside {
    order: -1;
  }

  .yb-editor[data-mode="edit"] .yb-editor__preview {
    display: none;
  }

  .yb-editor[data-mode="preview"] .yb-editor__doc {
    display: none;
  }

  /* The preview tab already shows the pages at full width: no zoom-in click there. */
  .yb-editor__pdf .yb-pdf__pages--button {
    cursor: default;
    pointer-events: none;
  }
}

@media (max-width: 767px) {
  .yb-editor-bar {
    gap: var(--yb-space-2);
    margin: calc(-1 * var(--yb-space-4)) calc(-1 * var(--yb-space-4)) 0;
    padding: var(--yb-space-2) var(--yb-space-4);
  }

  /* No breadcrumb on a phone: the title line is the bar's own centre. */
  .yb-editor-bar__status {
    align-self: center;
    min-height: 0;
  }

  .yb-editor-bar__crumbs,
  .yb-editor-bar__total,
  .yb-editor-bar__mode .mud-icon-root,
  .yb-editor-bar .yb-autosave__text {
    display: none;
  }

  .yb-editor-bar__title-line .yb-status {
    flex: none;
  }

  .yb-editor-bar__heading {
    flex: 1 1 0;
  }

  .yb-editor-bar__title {
    font-size: var(--yb-text-title-3);
    line-height: var(--yb-leading-title-3);
  }

  .yb-editor-bar__actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .yb-editor-bar__mode {
    margin-right: auto;
  }
}

/* ---------- The paper (laid out like the PDF, D027) ---------- */
.yb-paper {
  --yb-doc-accent: var(--yb-primary);
  --yb-paper-pad: 48px;
  container: paper / inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-6);
  max-width: 920px;
  padding: 48px var(--yb-paper-pad) 0;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
  box-shadow: var(--yb-shadow-sm);
}

.yb-paper__letterhead,
.yb-paper__band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--yb-space-6) var(--yb-space-8);
  align-items: start;
}

.yb-paper__brand {
  min-height: 40px;
}

.yb-paper__logo {
  display: block;
  max-width: 200px;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
}

.yb-paper__company-name {
  font-size: var(--yb-text-title-2);
  font-weight: var(--yb-weight-strong);
  letter-spacing: -0.01em;
}

.yb-paper__sender {
  display: flex;
  flex-direction: column;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-paper__sender-edit {
  align-self: flex-start;
  margin-top: var(--yb-space-1);
  color: var(--yb-primary);
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--yb-duration-fast) var(--yb-ease);
}

.yb-paper__letterhead:hover .yb-paper__sender-edit,
.yb-paper__sender-edit:focus-visible {
  opacity: 1;
}

.yb-paper__sender-edit:hover {
  text-decoration: underline;
}

/* Inputs typed "on the paper": a light tint tells them from what is printed (owner's choice, 2026-10-29). */
.yb-paper-input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 4px;
  background: var(--yb-field-tint);
  color: var(--yb-text);
  font: inherit;
  line-height: var(--yb-leading-body);
  transition: background-color var(--yb-duration-fast) var(--yb-ease), border-color var(--yb-duration-fast) var(--yb-ease);
}

textarea.yb-paper-input {
  resize: none;
  field-sizing: content;
  min-height: calc(2 * var(--yb-leading-body) + 8px);
}

.yb-paper-input::placeholder {
  color: var(--yb-text-disabled);
  opacity: 1;
}

.yb-paper-input:hover:not(:disabled) {
  background: var(--yb-field-tint-hover);
}

.yb-paper-input:focus {
  background: var(--yb-surface);
  box-shadow: inset 0 0 0 1px var(--yb-border-input), 0 0 0 2px color-mix(in srgb, var(--yb-focus) 35%, transparent);
  outline: none;
}

/* A document that cannot be edited is plain print: no tint. */
.yb-paper-input:disabled {
  background: transparent;
  color: var(--yb-text);
  cursor: default;
}

.yb-paper-input[aria-invalid="true"] {
  border-bottom: 2px solid var(--yb-error);
  background: var(--yb-error-soft);
}

input[type="date"].yb-paper-input {
  width: auto;
  min-width: 9.5rem;
}

.yb-paper-label {
  display: block;
  margin-bottom: var(--yb-space-1);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-paper-problem {
  display: block;
  margin-top: var(--yb-space-1);
  color: var(--yb-error);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

/* Dates, reference and amount due (left of the envelope window) */
.yb-paper__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.yb-paper__meta-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--yb-space-3);
}

.yb-paper__meta-row dt {
  padding-top: 5px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-paper__meta-row dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-2);
  min-width: 0;
  margin: 0;
}

.yb-paper__meta-row--problem dt {
  color: var(--yb-error);
}

/* A date takes the whole row, as « Votre référence » below it (the shortcuts wrap under it). */
.yb-paper__meta-row dd > .yb-date {
  flex: 1 1 100%;
}

.yb-paper__meta-row--due {
  margin-top: var(--yb-space-3);
  padding-top: var(--yb-space-3);
  border-top: 1px solid var(--yb-border);
}

.yb-paper__amount-due {
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
}

.yb-paper__amount-due .yb-money__amount {
  font-weight: var(--yb-weight-strong);
}

.yb-paper__due-shortcuts {
  margin-left: var(--yb-space-1);
}

/* "+10 j, +30 j, +60 j" only while the due date is being set (or missing): a lighter paper. */
.yb-paper__meta-row:not(:focus-within):not(.yb-paper__meta-row--problem) .yb-paper__due-shortcuts {
  display: none;
}

/* Envelope window (recipient). Its padding (room for the problem tint and the hover) is taken back by a negative
   margin: its text lines up with the sender's address above it, as on the PDF. */
.yb-recipient {
  position: relative;
  min-width: 0;
  margin-inline: calc(-1 * var(--yb-space-3));
  padding: var(--yb-space-2) var(--yb-space-3) var(--yb-space-3);
  border-radius: var(--yb-radius-sm);
}

/* The chosen client is one editable zone (Modifier, Changer): tinted as the fields. */
.yb-recipient--editable {
  background: var(--yb-field-tint);
  transition: background-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-recipient--editable:hover,
.yb-recipient--editable:focus-within {
  background: var(--yb-field-tint-hover);
}

.yb-recipient--problem {
  box-shadow: inset 3px 0 0 var(--yb-error);
  background: var(--yb-error-soft);
}

.yb-recipient__search {
  font-size: var(--yb-text-title-3);
}

/* D496: the client's field sits in the address window, on the right of the paper: its suggestions, wider than the field
   on a tablet, open towards the paper instead of past the edge of the screen. */
.yb-recipient .yb-suggest__list {
  right: 0;
  left: auto;
}

.yb-recipient__recent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1);
  margin-top: var(--yb-space-2);
}

.yb-recipient__recent-label {
  margin-right: var(--yb-space-1);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-chip--contact {
  max-width: 12rem;
}

.yb-recipient__address {
  display: flex;
  flex-direction: column;
  font-style: normal;
  line-height: 1.5;
}

.yb-recipient__line--name {
  font-weight: var(--yb-weight-strong);
}

.yb-recipient__line--email {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-recipient__line--missing {
  color: var(--yb-error);
  font-size: var(--yb-text-caption);
}

.yb-recipient__none {
  color: var(--yb-text-muted);
}

.yb-recipient__fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yb-recipient__name {
  font-weight: var(--yb-weight-strong);
}

.yb-recipient__pair {
  display: grid;
  gap: var(--yb-space-2);
}

.yb-recipient__pair--street {
  grid-template-columns: minmax(0, 1fr) 4.5rem;
}

.yb-recipient__pair--city {
  grid-template-columns: 5rem minmax(0, 1fr);
}

.yb-recipient__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-1) var(--yb-space-4);
  margin-top: var(--yb-space-2);
}

.yb-recipient__actions--hover {
  opacity: 0;
  transition: opacity var(--yb-duration-fast) var(--yb-ease);
}

.yb-recipient:hover .yb-recipient__actions--hover,
.yb-recipient:focus-within .yb-recipient__actions--hover {
  opacity: 1;
}

@media (hover: none) {
  .yb-recipient__actions--hover {
    opacity: 1;
  }
}

.yb-recipient__hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-recipient__hint .mud-icon-root {
  font-size: 16px;
}

.yb-recipient__differs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--yb-space-2);
  margin-top: var(--yb-space-3);
  padding: var(--yb-space-2) var(--yb-space-3);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-info-soft);
  font-size: var(--yb-text-caption);
}

.yb-recipient__differs .mud-icon-root {
  color: var(--yb-info);
  font-size: 16px;
}

/* Suggestions (combobox) */
.yb-suggest {
  position: relative;
  min-width: 0;
}

/* The units of a line (D296): a short list, no wider than needed. */
.yb-line__cell--unit .yb-suggest__list {
  width: max(100%, 11rem);
}

.yb-suggest__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  width: max(100%, 22rem);
  max-width: min(36rem, 90vw);
  max-height: 20rem;
  margin: 0;
  padding: var(--yb-space-1);
  overflow-y: auto;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface-raised);
  box-shadow: var(--yb-shadow-md);
  list-style: none;
}

.yb-suggest__option {
  padding: var(--yb-space-2) var(--yb-space-3);
  border-radius: var(--yb-radius-sm);
  cursor: pointer;
}

.yb-suggest__option--active {
  background: var(--yb-selected);
}

.yb-suggest__footer {
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px solid var(--yb-border);
}

.yb-suggest__footer:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.yb-suggest__create {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  width: 100%;
  min-width: 0;
  padding: var(--yb-space-2) var(--yb-space-3);
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-primary);
  font: inherit;
  font-weight: var(--yb-weight-medium);
  text-align: left;
  cursor: pointer;
}

.yb-suggest__create:hover,
.yb-suggest__create:focus-visible {
  background: var(--yb-hover);
}

.yb-suggest-contact,
.yb-suggest-article {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  min-width: 0;
}

.yb-suggest-contact__text,
.yb-suggest-article__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.yb-suggest-contact__name,
.yb-suggest-article__name {
  font-weight: var(--yb-weight-medium);
}

.yb-suggest-contact__meta,
.yb-suggest-article__desc {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-suggest-article__price {
  flex: none;
  font-weight: var(--yb-weight-medium);
  white-space: nowrap;
}

.yb-suggest-article__unit {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-regular);
}

.yb-monogram--small {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

/* Title of the document: the accent bar of the PDF, in the company's colour */
.yb-paper__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--yb-space-1) var(--yb-space-3);
  margin-top: var(--yb-space-3);
  padding-left: var(--yb-space-4);
  box-shadow: inset 4px 0 0 var(--yb-doc-accent);
}

.yb-paper__title-text {
  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);
}

.yb-paper__title-number {
  color: var(--yb-text-muted); /* informative text: 4.5:1 (WCAG 1.4.3) */
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-medium);
  cursor: help;
}

.yb-paper__options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2);
  margin-top: calc(-1 * var(--yb-space-2));
}

.yb-paper-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 4px 0 8px;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-pill);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-paper-option:hover,
.yb-paper-option:focus-within {
  border-color: var(--yb-border-input);
  color: var(--yb-text);
}

.yb-paper-option .mud-icon-root {
  font-size: 16px;
}

.yb-paper-option--plain {
  padding-left: 4px;
}

.yb-paper-option__select {
  height: 26px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--yb-text);
  font: inherit;
  cursor: pointer;
}

.yb-paper-option__select:focus {
  outline: none;
}

.yb-paper-option.yb-segmented {
  height: 28px;
  padding: 1px;
  border-radius: var(--yb-radius-pill);
}

.yb-paper-option.yb-segmented .yb-segmented__option {
  white-space: nowrap;
  height: 24px;
  border-radius: var(--yb-radius-pill);
  font-size: var(--yb-text-caption);
}

.yb-paper__subject {
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-strong);
}

.yb-paper__subject,
.yb-paper__intro {
  margin-bottom: calc(-1 * var(--yb-space-3));
}

/* The totals right under the lines, on the right as on the PDF; the closing text below them, on the whole width. */
.yb-paper__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--yb-space-5);
}

.yb-paper__bottom .yb-totals--sheet {
  order: -1;
  justify-self: end;
  width: min(100%, 21rem);
}

/* No payment part below (a quote): the closing text keeps a margin from the edge of the paper. */
.yb-paper > .yb-paper__bottom:last-child {
  margin-bottom: var(--yb-space-8);
}

.yb-paper__footer {
  color: var(--yb-text);
}

.yb-paper--skeleton {
  min-height: 540px;
  padding-bottom: var(--yb-space-8);
}

.yb-paper--skeleton .yb-paper__band > div,
.yb-paper--skeleton .yb-paper__sender {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
}

.yb-paper__skeleton-line {
  display: flex;
  justify-content: space-between;
  padding: var(--yb-space-3) 0;
  border-bottom: 1px solid var(--yb-border);
}

/* Reminder summary (reminders have no lines) */
.yb-reminder-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  align-items: start;
  gap: var(--yb-space-6);
}

.yb-reminder-summary__text {
  color: var(--yb-text-muted);
}

/* Payment part: the perforation of the QR-bill and what it will carry */
.yb-stub {
  margin: var(--yb-space-4) calc(-1 * var(--yb-paper-pad)) 0;
  padding: 0 var(--yb-paper-pad) var(--yb-space-6);
  border-radius: 0 0 var(--yb-radius-md) var(--yb-radius-md);
  background: color-mix(in srgb, var(--yb-bg-sunken) 55%, var(--yb-surface));
}

.yb-stub__perforation {
  margin: 0 calc(-1 * var(--yb-paper-pad)) var(--yb-space-4);
  background-color: var(--yb-surface);
}

.yb-stub .yb-perforation__scissors.mud-icon-root {
  left: var(--yb-paper-pad);
  background: var(--yb-surface);
}

.yb-stub--problem {
  box-shadow: inset 0 3px 0 var(--yb-error);
  background: var(--yb-error-soft);
}

.yb-stub__body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--yb-space-3) var(--yb-space-8);
}

.yb-stub__title {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
  flex-basis: 100%;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-stub__title .mud-icon-root {
  font-size: 18px;
}

.yb-stub__facts {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: var(--yb-space-3) var(--yb-space-8);
  margin: 0;
}

.yb-stub__fact dt {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-stub__fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2);
  margin: 2px 0 0;
}

.yb-stub__fact--amount {
  margin-left: auto;
  text-align: right;
}

.yb-stub__fact--amount dd {
  justify-content: flex-end;
  font-weight: var(--yb-weight-strong);
}

.yb-stub__missing {
  color: var(--yb-error);
  font-weight: var(--yb-weight-medium);
}

.yb-stub__select {
  min-width: 18rem;
}

@container paper (max-width: 520px) {
  .yb-paper__letterhead,
  .yb-paper__band {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-paper__band .yb-recipient {
    order: -1;
    margin: 0 calc(-1 * var(--yb-space-3));
  }

  .yb-paper__bottom,
  .yb-reminder-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-paper__bottom .yb-totals--sheet {
    width: 100%;
  }

  .yb-paper__sender {
    display: none;
  }

  .yb-stub__fact--amount {
    margin-left: 0;
    text-align: left;
  }

  .yb-stub__fact--amount dd {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .yb-paper {
    --yb-paper-pad: var(--yb-space-4);
    padding-top: var(--yb-space-5);
    border-radius: var(--yb-radius-sm);
  }

  .yb-paper-input {
    min-height: 40px;
    font-size: 16px;
  }
}

/* ---------- Lines ---------- */
.yb-lines {
  --yb-text-details: color-mix(in srgb, var(--yb-text) 25%, var(--yb-text-muted));
  --yb-col-handle: 22px;
  --yb-col-date: 8.25rem;
  --yb-col-qty: 3.75rem;
  --yb-col-unit: 4.5rem;
  --yb-col-price: 5.75rem;
  --yb-col-discount: 3.25rem;
  --yb-col-vat: 4.75rem;
  --yb-col-amount: 6.25rem;
  --yb-col-menu: 30px;
  container: lines / inline-size;
  margin: 0 calc(-1 * var(--yb-space-3));
}

.yb-lines__head,
.yb-line {
  display: grid;
  grid-template-columns: var(--yb-line-cols);
  align-items: start;
  column-gap: 2px;
}

.yb-lines__head {
  align-items: end;
  padding: 0 0 6px;
  border-bottom: 1.5px solid var(--yb-doc-accent);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-lines__head > span {
  padding: 0 6px;
}

.yb-lines__head-qty,
.yb-lines__head-price,
.yb-lines__head-amount {
  text-align: right;
}

.yb-lines__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-lines__empty {
  padding: var(--yb-space-4) var(--yb-space-3);
  color: var(--yb-text-muted);
}

.yb-lines__empty--problem {
  color: var(--yb-error);
}

.yb-line {
  position: relative;
  padding: 8px 0;
  border-bottom: 1px solid var(--yb-border);
  transition: background-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-line:hover,
.yb-line:focus-within {
  background: color-mix(in srgb, var(--yb-hover) 60%, transparent);
}

.yb-line__handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--yb-text-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity var(--yb-duration-fast) var(--yb-ease);
}

.yb-line:hover .yb-line__handle,
.yb-line:focus-within .yb-line__handle,
.yb-line__handle:focus-visible {
  opacity: 1;
}

.yb-line__handle:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-line__handle:active {
  cursor: grabbing;
}

.yb-line__desc {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-cell-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: var(--yb-field-tint);
  color: var(--yb-text);
  font: inherit;
  line-height: var(--yb-leading-body);
  transition: background-color var(--yb-duration-fast) var(--yb-ease), box-shadow var(--yb-duration-fast) var(--yb-ease);
}

.yb-cell-input::placeholder {
  color: var(--yb-text-disabled);
  opacity: 1;
}

.yb-cell-input:hover:not(:disabled) {
  background: var(--yb-field-tint-hover);
}

.yb-cell-input:focus {
  background: var(--yb-surface);
  box-shadow: inset 0 0 0 1px var(--yb-border-input), 0 0 0 2px color-mix(in srgb, var(--yb-focus) 35%, transparent);
  outline: none;
}

.yb-cell-input:disabled {
  background: transparent;
  color: var(--yb-text);
  opacity: 1;
}

.yb-cell-input--number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.yb-cell-input--invalid,
.yb-cell-input[aria-invalid="true"] {
  background: var(--yb-error-soft);
  box-shadow: inset 0 0 0 1px var(--yb-error);
}

textarea.yb-cell-input {
  height: auto;
  resize: none;
  field-sizing: content;
}

select.yb-cell-input {
  padding-right: 2px;
  cursor: pointer;
}

.yb-line__title {
  font-weight: var(--yb-weight-medium);
}

/* The title wraps (text area sized on its text) instead of being cut: long designations stay readable. */
textarea.yb-line__title {
  min-height: 30px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

/* The details: muted, yet a little darker than the usual muted text, which fell under 4.5:1 on the tint of the
   field over a highlighted line (4.36:1 in light). */
.yb-line__details,
.yb-line__details-text {
  color: var(--yb-text-details);
}

.yb-line__details {
  min-height: 26px;
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-line__title-text {
  padding: 4px 6px;
  font-weight: var(--yb-weight-medium);
}

.yb-line__details-text {
  padding: 0 6px 4px;
  font-size: var(--yb-text-caption);
  white-space: pre-line;
}

.yb-line__article {
  position: absolute;
  top: 7px;
  right: 6px;
  display: inline-flex;
  color: var(--yb-text-disabled);
  pointer-events: none;
}

.yb-line__article .mud-icon-root {
  font-size: 14px;
}

.yb-line__desc:focus-within .yb-line__article {
  display: none;
}

.yb-line__error {
  padding: 2px 6px 0;
  color: var(--yb-error);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

/* Wide paper (D432): the designation and the figures on the first row; the details, then the strip « Date · Rabais ·
   TVA », run under them as far as the amount. The menu ⋯ stays at the end of the first row. */
.yb-line__handle {
  grid-row: 1;
  grid-column: 1;
}

.yb-line__desc {
  grid-row: 1;
  grid-column: 2;
}

.yb-line__cells > .yb-line__cell {
  grid-row: 1;
}

.yb-line__menu {
  grid-row: 1;
  grid-column: -2 / -1;
}

.yb-line__more,
.yb-line__meta {
  grid-column: 2 / -2;
  min-width: 0;
}

.yb-line__details-text {
  display: block;
}

.yb-line__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--yb-space-5);
  padding-top: 2px;
}

.yb-line__meta > .yb-line__cell {
  display: flex;
  align-items: center;
  gap: 2px;
}

.yb-line__meta .yb-line__cell-label {
  display: inline;
  padding: 0 0 0 6px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
  white-space: nowrap;
}

.yb-line__meta .yb-line__date {
  width: var(--yb-col-date);
}

.yb-line__meta .yb-line__discount {
  width: var(--yb-col-discount);
}

.yb-line__meta .yb-line__vat {
  width: var(--yb-col-vat);
}

/* The cells take part in the row grid on wide paper, and become a wrapped strip on narrow paper. */
.yb-line__cells {
  display: contents;
}

.yb-line__cell {
  min-width: 0;
}

.yb-line__cell-label {
  display: none;
}

.yb-line__percent {
  display: flex;
  align-items: center;
  color: var(--yb-text-muted);
}

.yb-line__percent .yb-cell-input {
  padding-right: 2px;
}

.yb-line__amount {
  display: block;
  padding: 4px 6px;
  font-weight: var(--yb-weight-medium);
  line-height: var(--yb-leading-body);
  text-align: right;
  white-space: nowrap;
}

.yb-line__menu {
  opacity: 0;
  transition: opacity var(--yb-duration-fast) var(--yb-ease);
}

.yb-line:hover .yb-line__menu,
.yb-line:focus-within .yb-line__menu,
.yb-line__menu:focus-within {
  opacity: 1;
}

@media (hover: none) {
  .yb-line__handle,
  .yb-line__menu {
    opacity: 1;
  }
}

.yb-line__text {
  grid-column: 2 / -2;
}

.yb-line__textarea {
  color: var(--yb-text);
}

.yb-line__subtotal {
  display: flex;
  grid-column: 2 / -2;
  justify-content: flex-end;
  gap: var(--yb-space-6);
  padding: 4px 6px;
  border-top: 1px solid var(--yb-text-muted);
  font-weight: var(--yb-weight-strong);
}

.yb-line__subtotal .yb-line__amount {
  padding: 0;
}

.yb-line__pagebreak {
  display: flex;
  grid-column: 2 / -2;
  align-items: center;
  gap: var(--yb-space-3);
  height: 30px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-line__pagebreak::before,
.yb-line__pagebreak::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--yb-border-strong);
}

.yb-line--drop-before {
  box-shadow: inset 0 2px 0 var(--yb-primary);
}

.yb-line--drop-after {
  box-shadow: inset 0 -2px 0 var(--yb-primary);
}

.yb-line--dragging {
  opacity: 0.45;
}

.yb-line--error {
  background: color-mix(in srgb, var(--yb-error-soft) 60%, transparent);
}

.yb-lines__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2);
  padding: var(--yb-space-2) 0 0 var(--yb-col-handle);
}

.yb-lines__add-button {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
  height: 34px;
  padding: 0 var(--yb-space-3);
  border: 1px dashed var(--yb-border-input);
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-primary);
  font: inherit;
  font-weight: var(--yb-weight-medium);
  cursor: pointer;
  transition: background-color var(--yb-duration-fast) var(--yb-ease), border-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-lines__add-button:hover {
  border-color: var(--yb-primary);
  background: var(--yb-hover);
}

.yb-lines__add-button:focus-visible,
.yb-lines__add-kind:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-lines__add-hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-regular);
}

.yb-lines__add-hint kbd,
.yb-shortcuts kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--yb-border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--yb-surface);
  color: var(--yb-text-muted);
  font: inherit;
  font-size: 11px;
}

.yb-lines__add-more {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
}

.yb-lines__add-kind {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 var(--yb-space-2);
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-text-muted);
  font: inherit;
  font-size: var(--yb-text-caption);
  cursor: pointer;
}

.yb-lines__add-kind:hover {
  background: var(--yb-hover);
  color: var(--yb-text);
}

.yb-lines__add-kind .mud-icon-root {
  font-size: 16px;
}

.yb-lines__columns {
  margin-left: auto;
}

/* Stacked (D432): once the designation would get less than about 15rem beside the figures (a paper narrowed by the
   preview, a mid-size window), it takes the whole width and the figures go under it, each with its name, at their
   usual width, the amount at the end. */
@container lines (max-width: 629.98px) {
  .yb-lines__head {
    display: none;
  }

  .yb-line {
    grid-template-columns: var(--yb-col-handle) minmax(0, 1fr) var(--yb-col-menu);
  }

  .yb-line__cells {
    display: flex;
    flex-wrap: wrap;
    grid-column: 2 / 3;
    align-items: flex-end;
    gap: var(--yb-space-1) var(--yb-space-2);
    padding: var(--yb-space-1) 0 0;
  }

  .yb-line__cells > .yb-line__cell {
    display: flex;
    flex-direction: column;
  }

  .yb-line__cells > .yb-line__cell--qty {
    width: var(--yb-col-qty);
  }

  .yb-line__cells > .yb-line__cell--unit {
    width: var(--yb-col-unit);
  }

  .yb-line__cells > .yb-line__cell--price {
    width: var(--yb-col-price);
  }

  .yb-line__cells > .yb-line__cell--amount {
    margin-left: auto;
    text-align: right;
  }

  .yb-line__cells .yb-line__cell-label {
    display: block;
    padding: 0 6px;
    color: var(--yb-text-muted);
    font-size: 11.5px;
    line-height: 1.3;
  }

  .yb-line__cells > .yb-line__cell--amount .yb-line__cell-label {
    text-align: right;
  }
}

/* Phone width: the figures share the width, the amount on its own row; touch-sized fields; the strip under the line
   laid out like the figures. */
@container lines (max-width: 539.98px) {
  .yb-line__cells > .yb-line__cell {
    flex: 1 1 4.5rem;
    width: auto;
  }

  .yb-line__cells > .yb-line__cell--qty,
  .yb-line__cells > .yb-line__cell--unit,
  .yb-line__cells > .yb-line__cell--price {
    width: auto;
  }

  .yb-line__cells > .yb-line__cell--amount {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    margin-left: 0;
    padding-top: var(--yb-space-1);
  }

  .yb-line__cells > .yb-line__cell--amount .yb-line__cell-label {
    text-align: left;
  }

  .yb-line {
    padding: var(--yb-space-2) 0;
  }

  .yb-line__meta {
    gap: var(--yb-space-1) var(--yb-space-2);
    padding-top: var(--yb-space-1);
  }

  .yb-line__meta > .yb-line__cell {
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 4.5rem;
  }

  .yb-line__meta > .yb-line__cell--date {
    flex-basis: 8.5rem;
  }

  .yb-line__meta .yb-line__cell-label {
    display: block;
    padding: 0 6px;
    font-size: 11.5px;
    line-height: 1.3;
  }

  .yb-line__meta .yb-line__date,
  .yb-line__meta .yb-line__discount,
  .yb-line__meta .yb-line__vat {
    width: 100%;
  }

  /* Touch-sized; tinted as on a wide screen, title and description included (owner's choice, 2026-10-29). */
  .yb-cell-input {
    height: 40px;
  }

  .yb-line__title {
    min-height: 40px;
    padding-block: 9px;
  }

  .yb-lines__add {
    padding-left: 0;
  }

  .yb-lines__add-hint {
    display: none;
  }

  .yb-lines__columns {
    display: none;
  }
}

/* ---------- Totals ---------- */
.yb-totals {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
}

.yb-totals--aside {
  padding: var(--yb-space-5);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-totals--sheet {
  padding-top: var(--yb-space-1);
}

.yb-totals__rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.yb-totals__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-3);
  min-height: 30px;
  font-variant-numeric: tabular-nums;
}

.yb-totals__row dt {
  min-width: 0;
  color: var(--yb-text-muted);
}

.yb-totals__row dd {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--yb-space-2);
  margin: 0;
  white-space: nowrap;
}

.yb-totals__row--strong dt,
.yb-totals__row--strong dd {
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
}

.yb-totals__row--muted dt,
.yb-totals__row--muted dd {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-totals__row--vat dt {
  font-size: var(--yb-text-caption);
}

.yb-totals__row--problem dt {
  color: var(--yb-error);
}

.yb-totals__discount {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-1);
}

.yb-totals__input.yb-cell-input {
  width: 5.5rem;
  box-shadow: inset 0 0 0 1px var(--yb-border);
}

.yb-totals__discount-amount {
  min-width: 5rem;
  text-align: right;
}

.yb-totals__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  margin-top: var(--yb-space-2);
  padding-top: var(--yb-space-3);
  border-top: 2px solid var(--yb-text);
}

.yb-totals__total-label {
  font-weight: var(--yb-weight-strong);
}

.yb-totals__total-amount .yb-money__amount {
  font-weight: var(--yb-weight-strong);
}

.yb-totals__total--problem {
  border-top-color: var(--yb-error);
}

/* ---------- Summary of the aside: the total, then whether the document can leave ---------- */
/* flex: none — in the sticky aside, a clipped child would otherwise shrink and hide its last problems. */
.yb-editor__summary {
  flex: none;
  overflow: hidden;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-editor__summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--yb-space-3);
  margin: 0;
  padding: var(--yb-space-4) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
}

.yb-editor__summary-label {
  color: var(--yb-text-muted);
  font-weight: var(--yb-weight-medium);
}

.yb-editor__summary-amount .yb-money__amount {
  font-weight: var(--yb-weight-strong);
}

.yb-editor__summary .yb-readiness {
  border: 0;
  border-radius: 0;
}

/* ---------- Readiness ---------- */
.yb-readiness {
  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-readiness--ready {
  border-color: transparent;
  background: var(--yb-success-soft);
}

.yb-readiness__ready {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  color: var(--yb-success);
  font-weight: var(--yb-weight-medium);
}

.yb-readiness--problem {
  border-color: var(--yb-error);
  box-shadow: inset 3px 0 0 var(--yb-error);
}

.yb-readiness__title {
  margin-bottom: var(--yb-space-2);
  font-size: var(--yb-text-title-3);
  line-height: var(--yb-leading-title-3);
  font-weight: var(--yb-weight-title-3);
}

.yb-readiness__list {
  margin: 0 calc(-1 * var(--yb-space-2));
  padding: 0;
  list-style: none;
}

.yb-readiness__item {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-2);
  width: 100%;
  padding: 6px var(--yb-space-2);
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.yb-readiness__item:hover {
  background: var(--yb-hover);
}

.yb-readiness__item:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-readiness__dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--yb-accent);
}

.yb-readiness--problem .yb-readiness__dot {
  background: var(--yb-error);
}

.yb-readiness__text {
  flex: 1;
}

.yb-readiness__go.mud-icon-root {
  flex: none;
  margin-top: 2px;
  color: var(--yb-text-muted);
  font-size: 16px;
}

/* ---------- Dialogs: payment, send, preview, shortcuts ---------- */
.yb-pay-dialog__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--yb-space-4);
}

.yb-pay-dialog__amount-field input {
  font-size: var(--yb-text-title-2);
  font-weight: var(--yb-weight-strong);
  font-variant-numeric: tabular-nums;
}

.yb-pay-dialog__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 17px;
  margin: 6px 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-pay-dialog__hint--warn {
  color: var(--yb-warning);
}

.yb-pay-dialog__hint--done {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--yb-success);
  font-weight: var(--yb-weight-medium);
}

.yb-pay-dialog__date .yb-chip-row {
  margin-top: 6px;
}

.yb-pay-dialog__methods {
  flex-wrap: wrap;
}

@media (max-width: 767px) {
  .yb-pay-dialog__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .yb-pay-dialog__methods.yb-segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* As tall as its content up to the edge of the screen, then the content scrolls under fixed actions. */
.yb-send-dialog .mud-dialog-content.yb-send-dialog__content {
  min-height: 0;
}

.yb-send-channel__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--yb-space-3);
}

.yb-send-option {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) 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;
  transition: border-color var(--yb-duration-fast) var(--yb-ease), background-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-send-option:hover {
  border-color: var(--yb-border-input);
}

.yb-send-option:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-send-option > .mud-icon-root {
  flex: none;
  margin-top: 2px;
  color: var(--yb-text-muted);
}

.yb-send-option--selected,
.yb-send-option--selected:hover {
  border-color: var(--yb-primary);
  background: var(--yb-primary-soft);
  box-shadow: inset 0 0 0 1px var(--yb-primary);
}

.yb-send-option--selected > .mud-icon-root {
  color: var(--yb-primary);
}

.yb-send-option__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-send-option__label {
  font-weight: var(--yb-weight-strong);
}

.yb-send-option__hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-send-warning,
.yb-send-problems {
  display: flex;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4);
  border-radius: var(--yb-radius-md);
  background: var(--yb-warning-soft);
}

.yb-send-warning > .mud-icon-root {
  flex: none;
  color: var(--yb-warning);
}

.yb-send-warning__title,
.yb-send-problems__title {
  font-weight: var(--yb-weight-strong);
}

.yb-send-warning__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-2);
  margin-top: var(--yb-space-2);
}

.yb-send-problems {
  flex-direction: column;
  gap: var(--yb-space-1);
  background: var(--yb-error-soft);
}

.yb-send-problems ul {
  margin: 0;
  padding-left: var(--yb-space-5);
}

.yb-send-problems li {
  margin: 2px 0;
}

/* The prepared message, folded to its first lines (audit UX). */
.yb-send-message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--yb-space-1);
}

.yb-send-message__preview {
  margin: 0;
  padding: var(--yb-space-2) var(--yb-space-3);
  align-self: stretch;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
}

.yb-send-message__subject {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The clamp is on the text itself: the padding of the box never shows half of a fourth line. */
.yb-send-message__preview > span {
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.yb-send-message__edit.mud-button-root {
  margin-inline-start: calc(var(--yb-space-2) * -1);
}

/* « En allemand, la langue de ce client. » above the subject (audit UX). */
.yb-send-language {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-send-post {
  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);
}

.yb-attachment {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  padding: var(--yb-space-2) var(--yb-space-3);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-bg);
}

.yb-attachment__thumb {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--yb-border);
  border-radius: 3px;
  background: #fff;
  color: var(--yb-error);
  box-shadow: var(--yb-shadow-xs);
}

.yb-attachment__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.yb-attachment__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.yb-attachment__name {
  font-weight: var(--yb-weight-medium);
}

.yb-attachment__hint {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-send-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--yb-space-2);
  padding: var(--yb-space-4) var(--yb-space-2) var(--yb-space-2);
  text-align: center;
}

.yb-send-done__illustration {
  width: 168px;
  height: auto;
  margin-bottom: var(--yb-space-2);
  animation: yb-send-away var(--yb-duration-slow) var(--yb-ease) both;
}

.yb-send-done__title {
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-title-2);
}

.yb-send-done__number {
  display: flex;
  align-items: baseline;
  gap: var(--yb-space-2);
}

.yb-send-done__number-label {
  color: var(--yb-text-muted);
}

.yb-send-done__number-value {
  font-size: var(--yb-text-amount-hero);
  line-height: var(--yb-leading-amount-hero);
  font-weight: var(--yb-weight-strong);
  letter-spacing: -0.02em;
}

.yb-send-done__text {
  max-width: 28rem;
  margin-bottom: var(--yb-space-2);
  color: var(--yb-text-muted);
}

@keyframes yb-send-away {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 767px) {
  .yb-send-channel__options {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The large viewers (document, attachment) take the whole height of the screen, MudBlazor's margin aside (owner's
   choice, 2026-10-29): no height of their own. */
.mud-dialog.yb-preview-dialog {
  height: calc(100dvh - var(--mud-appbar-height));
}

.yb-preview-dialog .mud-dialog-content.yb-preview-dialog__content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

/* The fitted page stays a comfortable reading size (the zoom goes further, sharp at every size, lot 23). */
.yb-preview-dialog__pdf {
  --yb-pdf-fit-max: 900px;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.yb-shortcuts {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
  margin: 0;
}

.yb-shortcuts__row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: center;
  gap: var(--yb-space-3);
}

.yb-shortcuts__row dd {
  margin: 0;
}

/* ---------- Issued document page ---------- */
.yb-issued-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-bg-sunken);
}

.yb-issued-banner > .mud-icon-root {
  flex: none;
  margin-top: 2px;
  color: var(--yb-text-muted);
}

.yb-issued-banner p {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--yb-space-2);
}

.yb-issued-banner__hint {
  color: var(--yb-text-muted);
}

.yb-stat__value--small {
  font-size: var(--yb-text-title-3);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-strong);
}

.yb-stat--text .yb-stat__value {
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-title-2);
  font-weight: var(--yb-weight-strong);
}

.yb-stat--text.yb-stat--danger .yb-stat__value,
.yb-stat--text.yb-stat--danger .yb-stat__caption {
  color: var(--yb-error);
}

.yb-stat__value-link {
  color: var(--yb-primary);
  text-decoration: none;
}

.yb-stat__value-link:hover {
  text-decoration: underline;
}

/* The figures of an issued document, kept low (owner's choice, 2026-10-29): the PDF comes sooner. Smaller label and
   amounts than the dashboard's key figures, tighter cells. */
.yb-docview__figures .yb-stat-strip > .yb-stat {
  row-gap: 2px;
  padding: var(--yb-space-3) var(--yb-space-5);
}

.yb-docview__figures .yb-stat__label {
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-docview__figures .yb-stat__value {
  margin-top: 0;
}

.yb-docview__figures .yb-money--hero,
.yb-docview__figures .yb-amount-hero {
  font-size: var(--yb-text-amount-compact);
  line-height: var(--yb-leading-amount-compact);
}

.yb-docview__figures .yb-stat--text .yb-stat__value {
  font-size: var(--yb-text-title-2);
  line-height: var(--yb-leading-amount-compact);
}

/* A sentence rather than a figure (the answer to a quote). */
.yb-docview__figures .yb-stat--text .yb-stat__value--small {
  font-size: var(--yb-text-title-3);
}

@container stats (max-width: 519px) {
  .yb-docview__figures .yb-stat-strip > .yb-stat {
    padding: var(--yb-space-3) var(--yb-space-4);
  }
}

.yb-button--remind.mud-button-root {
  border-color: var(--yb-status-amber-fg);
  color: var(--yb-status-amber-fg);
}

.yb-docview {
  container: docview / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--yb-space-6);
}

.yb-docview__preview {
  position: relative;
  min-width: 0;
}

.yb-docview__preview .yb-pdf {
  overflow: hidden;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
}

.yb-docview__side {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  min-width: 0;
}

.yb-docview__empty {
  padding: var(--yb-space-4) var(--yb-space-5);
  color: var(--yb-text-muted);
}

@media (min-width: 1100px) {
  .yb-docview {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
  }

  /* D494: the payments and the history stay beside the document while it is read, as the column of the editor and the
     one of a recurring invoice; taller than the window, the column scrolls on its own. */
  .yb-docview__side {
    position: sticky;
    top: calc(var(--yb-topbar-height) + var(--yb-space-4));
    max-height: calc(100dvh - var(--yb-topbar-height) - var(--yb-space-8));
    /* Room for the focus rings of the rows, which the scrolling area would cut on its edges. */
    margin: calc(-1 * var(--yb-space-1));
    padding: var(--yb-space-1);
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

/* Narrow: the document (and the reminder shown) first, the payments and the history after (audit UX: two reviewers
   looked for what was sent at the bottom of the page). */

.yb-payments,
.yb-linked {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-payment {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: var(--yb-space-3);
  min-height: 56px;
  padding: var(--yb-space-2) var(--yb-space-3) var(--yb-space-2) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
}

.yb-payment:last-child {
  border-bottom: 0;
}

.yb-payment__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-success-soft);
  color: var(--yb-success);
}

.yb-payment__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-payment__method {
  font-weight: var(--yb-weight-medium);
}

.yb-payment__meta {
  overflow: hidden;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* « Voir l'écriture bancaire » under a payment applied from a bank statement (lot 22b, D149). */
.yb-payment__entry {
  align-self: flex-start;
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
}

.yb-payment__entry:hover {
  text-decoration: underline;
}

.yb-payment__amount .yb-money__amount {
  font-weight: var(--yb-weight-strong);
}

.yb-linked__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "type number status"
    "date date amount";
  align-items: center;
  gap: 2px var(--yb-space-3);
  padding: var(--yb-space-3) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
  color: var(--yb-text);
  text-decoration: none;
}

.yb-linked li:last-child .yb-linked__row {
  border-bottom: 0;
}

.yb-linked__row:hover {
  background: var(--yb-hover);
  color: var(--yb-text);
}

.yb-linked__type {
  grid-area: type;
  color: var(--yb-text-muted);
}

.yb-linked__number {
  grid-area: number;
  font-weight: var(--yb-weight-medium);
}

.yb-linked__row .yb-status {
  grid-area: status;
}

.yb-linked__date {
  grid-area: date;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-linked__amount {
  grid-area: amount;
  justify-self: end;
}

/* The reminder shown in the page of its invoice (D180). */
.yb-linked__row--current,
.yb-linked__row--current:hover {
  box-shadow: inset 3px 0 0 var(--yb-primary);
  background: var(--yb-selected);
}

.yb-docview__preview {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-3);
}

.yb-docview__reminder {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
  padding: var(--yb-space-3) var(--yb-space-4);
  border: 1px solid var(--yb-border);
  border-left: 3px solid var(--yb-status-amber-fg);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

.yb-docview__reminder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2) var(--yb-space-3);
}

.yb-docview__reminder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-status-amber-bg);
  color: var(--yb-status-amber-fg);
}

.yb-docview__reminder-title {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--yb-space-2);
  margin: 0;
  font-size: var(--yb-text-title-3);
  line-height: var(--yb-leading-title-3);
  font-weight: var(--yb-weight-title-3);
}

/* Focused by the page to bring the reminder into view and read its title out; not a control of its own. */
.yb-docview__reminder-title:focus {
  outline: none;
}

.yb-docview__reminder-number {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-body);
  font-weight: var(--yb-weight-regular);
}

.yb-docview__reminder-actions {
  display: flex;
  align-items: center;
  gap: var(--yb-space-1);
  margin-left: auto;
}

.yb-docview__reminder-sent,
.yb-docview__reminder-note {
  margin: 0;
  color: var(--yb-text-muted);
}

.yb-docview__reminder-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--yb-space-2) var(--yb-space-8);
  margin: 0;
}

.yb-docview__reminder-facts dt {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-docview__reminder-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--yb-space-2);
  margin: 0;
  font-weight: var(--yb-weight-medium);
}

.yb-docview__reminder-caption {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-regular);
}

.yb-docview__reminder-late,
.yb-docview__reminder-late .yb-docview__reminder-caption {
  color: var(--yb-error);
}

.yb-docview__reminder-loading {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-1);
}

/* Timeline */
.yb-timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--yb-space-3);
  padding-bottom: var(--yb-space-4);
}

.yb-timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 30px;
  bottom: 2px;
  left: 13.5px;
  width: 1px;
  background: var(--yb-border-strong);
}

.yb-timeline__item:last-child {
  padding-bottom: 0;
}

.yb-timeline__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--yb-status-neutral-bg);
  color: var(--yb-status-neutral-fg);
}

.yb-timeline__dot .mud-icon-root {
  font-size: 15px;
}

.yb-timeline__item--blue .yb-timeline__dot { background: var(--yb-status-blue-bg); color: var(--yb-status-blue-fg); }
.yb-timeline__item--green .yb-timeline__dot { background: var(--yb-status-green-bg); color: var(--yb-status-green-fg); }
.yb-timeline__item--petrol .yb-timeline__dot { background: var(--yb-status-petrol-bg); color: var(--yb-status-petrol-fg); }
.yb-timeline__item--amber .yb-timeline__dot { background: var(--yb-status-amber-bg); color: var(--yb-status-amber-fg); }
.yb-timeline__item--orange .yb-timeline__dot { background: var(--yb-status-orange-bg); color: var(--yb-status-orange-fg); }
.yb-timeline__item--bordeaux .yb-timeline__dot { background: var(--yb-status-bordeaux-bg); color: var(--yb-status-bordeaux-fg); }
.yb-timeline__item--red .yb-timeline__dot { background: var(--yb-status-red-bg); color: var(--yb-status-red-fg); }

.yb-timeline__body {
  min-width: 0;
  padding-top: 3px;
}

.yb-timeline__text {
  overflow-wrap: anywhere;
}

.yb-timeline__link {
  margin-left: var(--yb-space-2);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
}

.yb-timeline__link:hover {
  text-decoration: underline;
}

.yb-timeline__meta {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

@media (prefers-reduced-motion: reduce) {
  .yb-send-done__illustration,
  .yb-autosave__icon,
  .yb-editor__preview-sync .mud-icon-root {
    animation: none !important;
  }
}

.yb-filter-chip--more .mud-icon-root {
  font-size: 16px;
}

.yb-filter-more__count {
  color: var(--yb-text-muted);
}

/* ---------- Client record: documents and payments of the client ---------- */
.yb-contact__side {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  min-width: 0;
}

.yb-history {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The status gets a column of its own width, chips aligned on its left: the amounts line up from row to row whatever
   the length of the status ("Payée", "Partiellement payée"). Rows without a status (payments) end on the amount. */
.yb-history__row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 9.5rem;
  align-items: center;
  gap: var(--yb-space-3);
  min-height: 56px;
  padding: var(--yb-space-2) var(--yb-space-5);
  border-bottom: 1px solid var(--yb-border);
  color: var(--yb-text);
  text-decoration: none;
}

/* A row that opens its document over the page (owner's rule of 2026-11-07): a button laid out like the link it was. */
button.yb-history__row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-history__row:not(:has(> .yb-status)) {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}

.yb-history__row > .yb-status {
  justify-self: start;
}

.yb-history li:last-child .yb-history__row {
  border-bottom: 0;
}

/* D494: « Tout afficher (N) » under the latest documents or payments of a client. */
.yb-history__more {
  display: flex;
  justify-content: center;
  padding: var(--yb-space-2);
  border-top: 1px solid var(--yb-border);
}

.yb-history__row:hover {
  background: var(--yb-hover);
  color: var(--yb-text);
}

.yb-history__row:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-history__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
}

.yb-history__icon--paid {
  background: var(--yb-success-soft);
  color: var(--yb-success);
}

.yb-history__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-history__title {
  overflow: hidden;
  font-weight: var(--yb-weight-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-history__date {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-history__amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.yb-history__balance {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
  .yb-history__row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    padding: var(--yb-space-3) var(--yb-space-4);
  }

  .yb-history__row > .yb-status {
    grid-column: 2;
    justify-self: start;
  }

  /* "Paiement de la facture F-2026-0018": the number is the information, it wraps instead of being cut. */
  .yb-history__title {
    white-space: normal;
  }
}

/* Status filter on phones: a native select dressed like a filter chip. */
.yb-filter-select {
  position: relative;
  display: flex;
  align-items: center;
}

.yb-filter-select select {
  width: 100%;
  height: var(--yb-touch-target);
  padding: 0 var(--yb-space-10) 0 var(--yb-space-4);
  border: 1px solid var(--yb-border-input);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-surface);
  color: var(--yb-text);
  font: inherit;
  font-size: 16px;
  font-weight: var(--yb-weight-medium);
  appearance: none;
}

.yb-filter-select select:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-filter-select .mud-icon-root {
  position: absolute;
  right: var(--yb-space-3);
  color: var(--yb-text-muted);
  pointer-events: none;
}

/* D496: a list of invoices of a laptop with the menu unfolded (956 px at 1280 px) was wider than its panel — the client's
   name squeezed to a few letters and the « Relancer » buttons cut. Under 1080 px the date of issue goes (the due date
   stays) and the cells come closer; under 900 px what is left to collect goes too (the status says « Partiellement
   payée »), as it already did under 720 px. */
@container table (max-width: 1080px) {
  .yb-doc-grid .yb-col-wide {
    display: none;
  }

  .yb-doc-grid.mud-table .mud-table-row .mud-table-cell {
    padding-right: var(--yb-space-2);
    padding-left: var(--yb-space-2);
  }
}

/* Narrow tables (tablets): the hidden quick actions would still take their width; the menu keeps every action. */
@container table (max-width: 900px) {
  .yb-row-actions__quick {
    display: none;
  }

  .yb-doc-grid .yb-col-optional {
    display: none;
  }
}

@container table (max-width: 720px) {
  .yb-doc-grid.mud-table .mud-table-row .mud-table-cell {
    padding-right: var(--yb-space-2);
    padding-left: var(--yb-space-2);
  }

  /* Selection (ZIP of the PDFs) is a desk task: the checkbox column gives its width to the client names. */
  .yb-doc-grid.mud-table .mud-table-row > .mud-table-cell:first-child {
    display: none;
  }

  /* D496: a tablet held upright (620 px of table) still overflowed: the due date goes too — the status says « En retard
     +12 j », the document keeps its due date. */
  .yb-doc-grid .yb-col-due {
    display: none;
  }
}

/* ---------- Attachments: pages that follow the document in the same PDF (lot 24) ---------- */
.yb-annexes {
  --yb-annex-pad: var(--yb-space-6);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  max-width: 920px;
  margin-top: var(--yb-space-4);
  padding: var(--yb-space-5) var(--yb-annex-pad);
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}

/* Under the paper of the editor: the pages that follow it. */
.yb-editor__attachments {
  margin-top: var(--yb-space-5);
}

.yb-annexes__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--yb-space-3) var(--yb-space-4);
}

.yb-annexes__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--yb-radius-sm);
  background: var(--yb-primary-soft);
  color: var(--yb-on-primary-soft);
}

.yb-annexes__heading {
  flex: 1 1 14rem;
  min-width: 0;
}

.yb-annexes__title {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  margin: 0;
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-strong);
  line-height: var(--yb-leading-title-3);
}

.yb-annexes__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-bg-sunken);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
}

.yb-annexes__hint {
  margin: 2px 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-annexes__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--yb-space-2);
}

/* Empty (audit UX): one line — icon, title, a sentence, the two actions; the header is the whole panel. */
.yb-annexes:has(.yb-annexes__empty) {
  padding-block: var(--yb-space-4);
}

.yb-annexes__header:has(.yb-annexes__empty) {
  align-items: center;
}

.yb-annexes__none {
  margin: 0;
  color: var(--yb-text-muted);
}

/* The list: one row per attachment, like sheets laid one after the other. */
.yb-annexes__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  list-style: none;
}

.yb-annex {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  min-height: 60px;
  padding: var(--yb-space-2) var(--yb-space-2) var(--yb-space-2) var(--yb-space-3);
  transition: background-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-annex + .yb-annex {
  border-top: 1px solid var(--yb-border);
}

.yb-annex:hover {
  background: var(--yb-hover);
}

.yb-annex:first-child {
  border-radius: var(--yb-radius-md) var(--yb-radius-md) 0 0;
}

.yb-annex:last-child {
  border-radius: 0 0 var(--yb-radius-md) var(--yb-radius-md);
}

.yb-annex:only-child {
  border-radius: var(--yb-radius-md);
}

.yb-annex--dragging {
  opacity: 0.45;
}

.yb-annex--drop-before {
  box-shadow: inset 0 2px 0 var(--yb-primary);
}

.yb-annex--drop-after {
  box-shadow: inset 0 -2px 0 var(--yb-primary);
}

.yb-annex__handle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 36px;
  margin-right: calc(-1 * var(--yb-space-1));
  padding: 0;
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: transparent;
  color: var(--yb-text-muted);
  cursor: grab;
}

.yb-annex__handle:hover {
  background: var(--yb-bg-sunken);
  color: var(--yb-text);
}

.yb-annex__handle:active {
  cursor: grabbing;
}

.yb-annex__handle:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: 1px;
}

/* A small sheet with a folded corner: PDF in ink, image in petrol. */
.yb-annex__sheet {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  border: 1px solid var(--yb-border-strong);
  border-radius: 3px 8px 3px 3px;
  background:
    linear-gradient(225deg, var(--yb-bg-sunken) 0 7px, var(--yb-border-strong) 7px 8px, transparent 8px),
    var(--yb-surface);
  color: var(--yb-text-muted);
  box-shadow: var(--yb-shadow-xs);
}

.yb-annex__sheet--image {
  color: var(--yb-primary);
}

.yb-annex__sheet .mud-icon-root {
  font-size: 18px;
}

.yb-annex__sheet--busy {
  border-style: dashed;
  box-shadow: none;
}

.yb-annex__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.yb-annex__name {
  display: flex;
  align-self: flex-start;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--yb-text);
  font: inherit;
  font-weight: var(--yb-weight-medium);
  text-align: left;
  cursor: pointer;
}

.yb-annex__name:hover {
  color: var(--yb-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.yb-annex__name:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--yb-focus);
  outline-offset: 2px;
}

.yb-annex__name--busy {
  color: var(--yb-text-muted);
  cursor: default;
}

.yb-annex__name--busy:hover {
  color: var(--yb-text-muted);
  text-decoration: none;
}

.yb-annex__meta {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-annex__menu,
.yb-annex__remove,
.yb-annex__download {
  flex: none;
}

.yb-annex__remove:hover {
  color: var(--yb-error);
}

.yb-annex__progress.mud-progress-linear {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
}

.yb-annexes__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-2) var(--yb-space-4);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-annexes__usage {
  display: inline-flex;
  align-items: center;
  gap: var(--yb-space-2);
}

.yb-annexes__usage-bar {
  display: inline-block;
  width: 88px;
  height: 6px;
  overflow: hidden;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-bg-sunken);
}

.yb-annexes__usage-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--yb-primary);
}

.yb-annexes__usage--high .yb-annexes__usage-bar > span {
  background: var(--yb-accent);
}

.yb-annexes__usage--full {
  color: var(--yb-error);
  font-weight: var(--yb-weight-medium);
}

.yb-annexes__usage--full .yb-annexes__usage-bar > span {
  background: var(--yb-error);
}

.yb-annexes__frozen {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--yb-space-2);
}

.yb-annexes__frozen .mud-icon-root {
  flex: none;
  margin-top: 1px;
  font-size: 16px;
}

.yb-annexes__errors {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-2);
  padding: var(--yb-space-2) var(--yb-space-2) var(--yb-space-2) var(--yb-space-3);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-error-soft);
  color: var(--yb-text);
}

.yb-annexes__errors ul {
  flex: 1;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.yb-annexes__errors li + li {
  margin-top: var(--yb-space-1);
}

.yb-annexes__errors-icon.mud-icon-root {
  flex: none;
  margin-top: 3px;
  color: var(--yb-error);
}

/* Files dragged from the desktop: the whole zone becomes the drop target. */
.yb-annexes--dragging {
  border-color: var(--yb-primary);
}

.yb-annexes__drop {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--yb-space-2);
  border: 2px dotted var(--yb-primary);
  border-radius: inherit;
  background: color-mix(in srgb, var(--yb-primary-soft) 94%, transparent);
  color: var(--yb-on-primary-soft);
  font-weight: var(--yb-weight-strong);
  pointer-events: none;
}

.yb-annexes__drop .mud-icon-root {
  font-size: 28px;
}

.yb-annexes__drop-input {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  cursor: copy;
}

.yb-annexes__drop-input.is-active {
  pointer-events: auto;
}

/* Issued document: inside a side panel, frozen with it. */
.yb-annexes--compact {
  gap: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.yb-annexes--compact .yb-annexes__list {
  border: 0;
  border-radius: 0;
}

.yb-annexes--compact .yb-annex {
  padding-inline: var(--yb-space-4) var(--yb-space-3);
  border-radius: 0;
}

.yb-annexes--compact .yb-annexes__footer {
  padding: var(--yb-space-3) var(--yb-space-4);
  border-top: 1px solid var(--yb-border);
}

/* Paper clip of the lists and of the linked documents (lot 24). */
.yb-clip {
  display: inline-flex;
  align-items: center;
  margin-left: var(--yb-space-1);
  color: var(--yb-text-muted);
  vertical-align: -3px;
}

.yb-clip .mud-icon-root,
.mud-icon-root.yb-clip {
  font-size: 16px;
}

/* Send dialog: the attachments travel inside the one PDF. */
.yb-attachment__annexes {
  display: flex;
  align-items: center;
  gap: var(--yb-space-1);
  min-width: 0;
  margin-top: 2px;
  color: var(--yb-text);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-attachment__annexes .mud-icon-root {
  flex: none;
  color: var(--yb-primary);
  font-size: 16px;
}

.yb-attachment__annexes > span:not(.yb-attachment__annexes-names) {
  flex: none;
}

.yb-attachment__annexes-names {
  min-width: 0;
  color: var(--yb-text-muted);
  font-weight: 400;
}

.yb-attachment__annexes-names::before {
  content: "·";
  margin: 0 var(--yb-space-1);
}

/* Drive picker */
.yb-drive-pick .yb-picker__intro {
  margin-bottom: var(--yb-space-4);
}

.yb-drive-pick__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--yb-space-3);
  margin-bottom: var(--yb-space-3);
}

.yb-drive-pick__year {
  flex: 0 0 9rem;
}

.yb-drive-pick__search {
  flex: 1 1 14rem;
}

.yb-drive-pick__path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px var(--yb-space-1);
  margin-bottom: var(--yb-space-2);
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-drive-pick__path .mud-icon-root {
  font-size: 16px;
}

.yb-drive-pick__path [aria-current] {
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
}

.yb-drive-pick__list {
  min-height: 12rem;
  max-height: min(52vh, 28rem);
  overflow: auto;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  scrollbar-width: thin;
}

.yb-drive-pick__list > .mud-skeleton {
  margin: var(--yb-space-2) var(--yb-space-3);
}

.yb-drive-pick__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-drive-pick__items > li + li {
  border-top: 1px solid var(--yb-border);
}

.yb-drive-pick__folder {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  width: 100%;
  min-height: 48px;
  padding: var(--yb-space-2) var(--yb-space-3);
  border: 0;
  background: none;
  color: var(--yb-text);
  font: inherit;
  font-weight: var(--yb-weight-medium);
  text-align: left;
  cursor: pointer;
}

.yb-drive-pick__folder:hover {
  background: var(--yb-hover);
}

.yb-drive-pick__folder:focus-visible {
  outline: 2px solid var(--yb-focus);
  outline-offset: -2px;
}

.yb-drive-pick__folder > .mud-icon-root:first-child {
  color: var(--yb-primary);
}

.yb-drive-pick__folder > .yb-truncate {
  flex: 1;
}

.yb-drive-pick__folder-count {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: 400;
}

.yb-drive-pick__document {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  padding-left: var(--yb-space-3);
}

.yb-drive-pick__document:hover:not(.is-disabled) {
  background: var(--yb-hover);
}

.yb-drive-pick__document.is-selected {
  background: var(--yb-selected);
}

.yb-drive-pick__document label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--yb-space-3);
  min-width: 0;
  padding: var(--yb-space-2) var(--yb-space-3) var(--yb-space-2) 0;
  cursor: pointer;
}

.yb-drive-pick__document.is-disabled label {
  cursor: default;
}

.yb-drive-pick__document.is-disabled .yb-drive-pick__thumb,
.yb-drive-pick__document.is-disabled .yb-drive-pick__name {
  opacity: 0.55;
}

.yb-drive-pick__thumb {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--yb-border);
  border-radius: 3px;
  background: var(--yb-pdf-paper);
  color: var(--yb-text-muted);
}

.yb-drive-pick__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.yb-drive-pick__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-drive-pick__name {
  font-weight: var(--yb-weight-medium);
}

.yb-drive-pick__meta,
.yb-drive-pick__empty,
.yb-drive-pick__truncated {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-drive-pick__empty,
.yb-drive-pick__truncated {
  margin: 0;
  padding: var(--yb-space-4) var(--yb-space-3);
  text-align: center;
}

.yb-drive-pick__room {
  margin: var(--yb-space-3) 0 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-drive-pick__room.is-full {
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
}

/* Viewer of one attachment: an image as it is, on the desk of the PDF previews. */
.yb-annex-viewer__image {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: var(--yb-space-4);
  border-radius: var(--yb-radius-md);
  background: var(--yb-bg-sunken);
}

.yb-annex-viewer__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--yb-shadow-sm);
}

.yb-annex-viewer__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--yb-space-2);
}

.yb-annexes__drive-short {
  display: none;
}

@media (max-width: 767px) {
  .yb-annexes__drive-long {
    display: none;
  }

  .yb-annexes__drive-short {
    display: inline;
  }

  .yb-annexes {
    --yb-annex-pad: var(--yb-space-4);
    padding-block: var(--yb-space-4);
    border-radius: var(--yb-radius-sm);
  }

  .yb-annexes--compact {
    padding: 0;
  }

  .yb-annexes__actions {
    flex: 1 1 100%;
  }

  .yb-annexes__actions .yb-file-button,
  .yb-annexes__actions .mud-button-root {
    flex: 1;
  }

  .yb-annex {
    min-height: 64px;
  }

  .yb-annex__handle {
    display: none;
  }

  .yb-annexes__usage-bar {
    width: 64px;
  }
}

/* « Dupliquer aussi les 2 annexes ? » and the other questions of lot 24 */
.yb-choice-dialog__body {
  display: flex;
  align-items: flex-start;
  gap: var(--yb-space-3);
}

.yb-choice-dialog__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-primary-soft);
  color: var(--yb-on-primary-soft);
}

.yb-choice-dialog__icon .mud-icon-root {
  font-size: 20px;
}

.yb-choice-dialog__question {
  margin: 6px 0 var(--yb-space-2);
  font-weight: var(--yb-weight-strong);
}

.yb-choice-dialog__hint {
  margin: 0;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-choice-dialog .yb-dialog__actions {
  flex-wrap: wrap;
}

/* An invoice, a quote or a reminder shown over another page (owner's rule of 2026-11-07): the panel of a document. */
.yb-sales-window__error {
  margin: 0;
  padding: var(--yb-space-5);
  color: var(--yb-error);
}

/* The window of an invoice: « dont 20.00 de frais de rappel » under its amount (audit UX). */
.yb-sales-window__fees {
  display: block;
  margin-top: 2px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

/* D371: the invoice and its reminders, one chronological list above the document shown. */
.yb-docview__chain {
  margin-bottom: var(--yb-space-4);
  overflow: hidden;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-md);
  background: var(--yb-surface);
}
