/*
 * Layouts: application shell (side navigation / rail / bottom bar), public site, authentication, empty.
 * Pure CSS breakpoints so that prerendered HTML is already final: phone < 768 px, tablet 768–1279 px, desktop ≥ 1280 px.
 */

/* ==========================================================================
   Application shell: frame (desk) > sheet (blotter) > panels (paper)
   ========================================================================== */
.yb-shell {
  --yb-nav-current: var(--yb-nav-width);
  display: grid;
  grid-template-columns: var(--yb-nav-current) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--yb-frame);
}

.yb-shell[data-nav="rail"] {
  --yb-nav-current: var(--yb-rail-width);
}

@media (max-width: 1279px) {
  .yb-shell {
    --yb-nav-current: var(--yb-rail-width);
  }
}

/* ---------- Side navigation ---------- */
.yb-sidenav {
  container: sidenav / inline-size;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-4);
  height: 100dvh;
  padding: var(--yb-space-3) var(--yb-space-3) var(--yb-space-3);
  overflow: hidden auto;
  scrollbar-width: none;
}

.yb-sidenav__nav {
  flex: 1;
}

.yb-sidenav__footer {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-1);
}

.yb-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-text-muted);
  font: inherit;
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--yb-duration-fast) var(--yb-ease), color var(--yb-duration-fast) var(--yb-ease);
}

/* "Installer l'app" is a button: as wide as the links around it. */
button.yb-nav-item {
  width: 100%;
  justify-content: flex-start;
  text-align: start;
}

.yb-nav-item:hover {
  background: var(--yb-hover);
  color: var(--yb-text);
}

.yb-nav-item.is-active {
  background: var(--yb-surface);
  color: var(--yb-text);
  box-shadow: var(--yb-shadow-xs), inset 0 0 0 1px var(--yb-border);
}

.yb-nav-item__icon {
  position: relative;
  display: inline-flex;
  flex: none;
}

.yb-nav-item__glyph.mud-icon-root {
  font-size: var(--yb-icon-size);
}

.yb-nav-item__glyph--active,
.yb-nav-item.is-active .yb-nav-item__glyph {
  display: none;
}

.yb-nav-item.is-active .yb-nav-item__glyph--active {
  display: inline-block;
  color: var(--yb-primary);
}

.yb-nav-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-nav-item__short {
  display: none;
}

.yb-nav-item__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--yb-radius-pill);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
  font-variant-numeric: tabular-nums;
}

.yb-nav-item__count--danger {
  background: var(--yb-error-soft);
  color: var(--yb-error);
}

.yb-nav-item__count--todo {
  background: var(--yb-accent);
  color: var(--yb-on-accent);
}

.yb-nav-item__dot {
  display: none;
  position: absolute;
  top: -2px;
  right: -4px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--yb-frame);
  border-radius: 50%;
}

.yb-nav-item__dot--danger {
  background: var(--yb-error);
}

.yb-nav-item__dot--todo {
  background: var(--yb-accent);
}

.yb-sidenav__collapse {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-sidenav__collapse:hover {
  background: var(--yb-hover);
  color: var(--yb-text);
}

.yb-sidenav__collapse .mud-icon-root {
  font-size: var(--yb-icon-size);
}

@media (max-width: 1279px) {
  .yb-sidenav__collapse {
    display: none;
  }
}

/* Rail: icons with short labels under them (collapsed on desktop, always on tablets). */
.yb-shell[data-nav="rail"] .yb-sidenav {
  padding-right: var(--yb-space-1);
  padding-left: var(--yb-space-1);
}

@media (max-width: 1279px) {
  .yb-sidenav {
    padding-right: var(--yb-space-1);
    padding-left: var(--yb-space-1);
  }
}

@container sidenav (max-width: 120px) {
  .yb-sidenav .yb-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 6px 2px;
    text-align: center;
  }

  .yb-sidenav .yb-nav-item__label,
  .yb-sidenav .yb-nav-item__count,
  .yb-sidenav .yb-sidenav__collapse-label,
  .yb-sidenav .yb-company__text,
  .yb-sidenav .yb-company__chevron {
    display: none;
  }

  .yb-sidenav .yb-nav-item__short {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: var(--yb-text-caption);
    line-height: var(--yb-leading-caption);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .yb-sidenav .yb-nav-item__dot {
    display: block;
  }

  .yb-sidenav .yb-sidenav__collapse,
  .yb-sidenav .yb-company__button {
    justify-content: center;
  }
}

/* ---------- Sheet and top bar ---------- */
.yb-sheet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100dvh - 2 * var(--yb-sheet-inset));
  margin: var(--yb-sheet-inset) var(--yb-sheet-inset) var(--yb-sheet-inset) 0;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-lg);
  background: var(--yb-bg);
}

.yb-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  height: var(--yb-topbar-height);
  padding: 0 var(--yb-space-6);
  border-bottom: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-lg) var(--yb-radius-lg) 0 0;
  background: var(--yb-bg);
}

.yb-topbar__company {
  display: none;
  min-width: 0;
}

.yb-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  margin-left: auto;
}

.yb-topbar__icon.mud-icon-button {
  color: var(--yb-text-muted);
}

.yb-search-trigger {
  display: flex;
  align-items: center;
  gap: var(--yb-space-2);
  width: min(400px, 100%);
  height: var(--yb-control-height);
  padding: 0 var(--yb-space-2) 0 10px;
  border: 1px solid var(--yb-border);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-surface);
  color: var(--yb-text-muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--yb-duration-fast) var(--yb-ease);
}

.yb-search-trigger:hover {
  border-color: var(--yb-border-strong);
  color: var(--yb-text);
}

.yb-search-trigger__icon.mud-icon-root {
  font-size: var(--yb-icon-size);
}

.yb-search-trigger__text {
  flex: 1;
}

.yb-main {
  flex: 1;
  min-width: 0;
  padding: var(--yb-space-6) var(--yb-space-8) var(--yb-space-12);
}

.yb-main:focus {
  outline: none;
}

.yb-page {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-6);
  max-width: var(--yb-content-max);
}

/* ---------- Full-page lists (D491) ----------
   A page whose main object is a list carries yb-page--fill, and the element that holds the list carries yb-fill. On
   computers and tablets the page then fits the window: title, banners, tabs and toolbar stay in place, only the rows
   scroll (under a sticky column header) and the pager stays visible at the bottom of the panel. The list panel follows
   its content and stops at the bottom of the window (owner, 2026-11-27): a short list keeps a short panel. Pure CSS, as
   every breakpoint of the shell (DESIGN §8): the shell notices such a page with :has(), so the prerendered page is
   already right. On a phone, or a window lower than 600 px, the whole page scrolls as everywhere else. */
@media (min-width: 768px) and (min-height: 600px) {
  .yb-shell:has(.yb-page--fill) {
    height: 100dvh;
    min-height: 0;
  }

  .yb-shell:has(.yb-page--fill) .yb-sheet {
    height: calc(100dvh - 2 * var(--yb-sheet-inset));
    min-height: 0;
  }

  .yb-shell:has(.yb-page--fill) .yb-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Last resort: when what sits above the list leaves it less than its minimum, the page scrolls — nothing is cut. */
    overflow-y: auto;
    padding-bottom: var(--yb-space-6);
  }

  .yb-page--fill {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
  }

  .yb-page--fill > * {
    flex: none;
  }

  /* The chain from the page down to the area that scrolls: each link may shrink, none grows past its content. */
  .yb-page--fill .yb-fill,
  .yb-page--fill .yb-fill > .yb-panel__body,
  .yb-page--fill .yb-fill .yb-table-host,
  .yb-page--fill .yb-fill .mud-table {
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  .yb-page--fill .yb-fill > .yb-panel__body > * {
    flex: none;
  }

  .yb-page--fill .yb-fill > .yb-panel__body > .yb-table-host {
    flex: 0 1 auto;
  }

  /* MudDataGrid: its container scrolls, the pager stays under it. Every area that scrolls is positioned: what is
     placed absolutely inside it (texts for screen readers) stays in it instead of lengthening the window. */
  .yb-page--fill .yb-fill .mud-table-container {
    position: relative;
    flex: 0 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    /* A row reached with the keyboard never stops under the sticky header (WCAG 2.4.11, as D488 for the top bar). */
    scroll-padding-top: var(--yb-row-head-height);
  }

  .yb-page--fill .yb-fill .mud-table-pagination {
    flex: none;
  }

  /* Sticky column header; a shadow draws its bottom line (a collapsed border does not stick with the cell). */
  .yb-page--fill .yb-fill .mud-table-head .mud-table-cell {
    position: sticky;
    top: 0;
    z-index: 3;
    box-shadow: inset 0 -1px 0 var(--yb-border);
  }

  /* From five rows, the bordered panel keeps room for its toolbar, three rows and a half and its pager, whatever sits
     above it (then the page scrolls, last resort); a shorter list keeps its own height. The minimum is on the panel, not
     on the rows' area: the panel would otherwise cut what overflows it. */
  .yb-page--fill .yb-fill:has(tbody > tr:nth-child(5)) {
    min-height: 22rem;
  }

  .yb-page--fill .yb-fill:not(:has(tbody > tr:nth-child(5))) {
    flex-shrink: 0;
  }
}

/* D488: what scrolls into view (focus with the keyboard, an anchor) stops under the fixed top bar, and on a phone above
   the bottom bar — never half hidden under them (WCAG 2.4.11). */
html {
  scroll-padding-top: calc(var(--yb-topbar-height) + var(--yb-space-2));
}

@media (max-width: 767px) {
  html {
    scroll-padding-bottom: calc(var(--yb-bottomnav-height) + env(safe-area-inset-bottom) + var(--yb-space-2));
  }
}

/* ---------- Bottom navigation (phones) ---------- */
.yb-bottomnav {
  display: none;
}

@media (max-width: 767px) {
  .yb-shell {
    display: block;
    padding-bottom: calc(var(--yb-bottomnav-height) + env(safe-area-inset-bottom));
    background: var(--yb-bg);
  }

  .yb-sidenav {
    display: none;
  }

  .yb-sheet {
    min-height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .yb-topbar {
    gap: var(--yb-space-2);
    padding: 0 var(--yb-space-2) 0 var(--yb-space-3);
    border-radius: 0;
  }

  .yb-topbar__company {
    display: block;
    flex: 1;
  }

  .yb-topbar__company .yb-company__city {
    display: none;
  }

  .yb-topbar__actions {
    gap: 0;
    margin-left: 0;
  }

  .yb-new-menu {
    display: none;
  }

  .yb-search-trigger {
    justify-content: center;
    width: var(--yb-touch-target);
    height: var(--yb-touch-target);
    padding: 0;
    border: 0;
    background: none;
  }

  .yb-search-trigger .yb-search-trigger__text,
  .yb-search-trigger .yb-search-trigger__keys {
    display: none;
  }

  .yb-main {
    padding: var(--yb-space-4) var(--yb-space-4) var(--yb-space-8);
  }

  .yb-page {
    gap: var(--yb-space-5);
  }

  .yb-bottomnav {
    position: fixed;
    inset: auto 0 0;
    z-index: 1050;
    display: grid;
    /* minmax(0, 1fr): the five entries share 320 px (reflow, WCAG 1.4.10) instead of widening to their labels. */
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    height: calc(var(--yb-bottomnav-height) + env(safe-area-inset-bottom));
    padding: 0 var(--yb-space-1) env(safe-area-inset-bottom);
    border-top: 1px solid var(--yb-border);
    background: var(--yb-surface);
  }

  .yb-bottomnav .yb-nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    padding: 4px 0;
    background: none;
    box-shadow: none;
  }

  .yb-bottomnav .yb-nav-item.is-active {
    color: var(--yb-primary);
  }

  .yb-bottomnav .yb-nav-item__glyph.mud-icon-root {
    font-size: 24px;
  }

  .yb-bottomnav .yb-nav-item__label,
  .yb-bottomnav .yb-nav-item__count {
    display: none;
  }

  .yb-bottomnav .yb-nav-item__short {
    display: block;
    font-size: var(--yb-text-caption);
    line-height: var(--yb-leading-caption);
  }

  .yb-bottomnav .yb-nav-item__dot {
    display: block;
    border-color: var(--yb-surface);
  }

  .yb-bottomnav__create {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: var(--yb-radius-lg);
    background: var(--yb-primary);
    color: var(--yb-on-primary);
    box-shadow: var(--yb-shadow-sm);
    cursor: pointer;
  }

  .yb-bottomnav__create .mud-icon-root {
    font-size: 28px;
  }
}

/* ---------- Company switcher, avatar ---------- */
.yb-company {
  display: block;
  width: 100%;
}

.yb-company__button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px;
  border: 0;
  border-radius: var(--yb-radius-sm);
  background: none;
  color: var(--yb-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-company__button:hover {
  background: var(--yb-hover);
}

.yb-company__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.yb-company__name {
  overflow: hidden;
  font-weight: var(--yb-weight-strong);
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yb-company__city {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  line-height: var(--yb-leading-caption);
}

.yb-company__chevron.mud-icon-root {
  flex: none;
  color: var(--yb-text-muted);
  font-size: 18px;
}

.yb-company__popover {
  width: 300px;
}

.yb-company__popover .mud-menu-item,
.yb-company__popover .mud-menu-item .mud-menu-item-text {
  min-width: 0;
  overflow: hidden;
}

/* MudBlazor shifts the text of icon-less items to line it up with « Ajouter une société » (which has an icon): the
   monogram already plays that part, so the companies start at the left edge like the heading. */
.yb-company__popover .mud-menu-list .mud-menu-item.yb-company__item .mud-menu-item-text {
  margin-inline-start: 0;
}

.yb-company__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.yb-company__check.mud-icon-root {
  flex: none;
  margin-left: auto;
  color: var(--yb-primary);
  font-size: 18px;
}

.yb-monogram {
  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);
  color: var(--yb-on-primary);
  font-size: var(--yb-text-caption);
  font-weight: 650;
  letter-spacing: 0.02em;
}

.yb-monogram--small {
  width: 28px;
  height: 28px;
}

.yb-avatar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--yb-touch-target);
  height: var(--yb-touch-target);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.yb-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-primary-soft);
  color: var(--yb-on-primary-soft);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-strong);
}

.yb-avatar--large {
  width: 40px;
  height: 40px;
  font-size: var(--yb-text-body);
}

.yb-avatar-button:hover .yb-avatar {
  box-shadow: 0 0 0 3px var(--yb-hover);
}

.yb-user-menu {
  width: 280px;
}

.yb-user-menu__header {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  padding: var(--yb-space-2) 10px;
}

.yb-user-menu__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.yb-user-menu__name {
  font-weight: var(--yb-weight-strong);
}

.yb-user-menu__email {
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
}

.yb-user-menu__logout {
  margin: 0;
}

/* Help links that open the public site in a new tab say so with a small trailing icon. */
.yb-menu-external.mud-icon-root {
  margin-left: var(--yb-space-2);
  color: var(--yb-text-muted);
  font-size: 14px;
  vertical-align: -2px;
}

/* The icon keeps its own end margin (MudBlazor), as in the other items: no gap, or the label sits 12 px further. */
.yb-menu-button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.yb-menu-heading {
  padding: 6px 10px 4px;
  color: var(--yb-text-muted);
  font-size: var(--yb-text-caption);
  font-weight: var(--yb-weight-medium);
}

.yb-menu-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-4);
  width: 100%;
}

.yb-menu-check .mud-icon-root {
  color: var(--yb-primary);
}

.yb-menu-popover {
  min-width: 220px;
}

/* ---------- Search dialog (Ctrl K) ---------- */
.yb-search-dialog.mud-dialog {
  margin-top: 12vh;
  overflow: hidden;
}

.yb-search-dialog .yb-search-dialog__content.mud-dialog-content {
  padding: 0;
}

/* ---------- Bottom sheet (phones) ---------- */
.mud-dialog-container.mud-dialog-bottomcenter:has(.yb-action-sheet) {
  padding-bottom: 0;
}

.yb-action-sheet.mud-dialog {
  width: 100%;
  margin: 0;
  border-radius: var(--yb-radius-lg) var(--yb-radius-lg) 0 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.yb-action-sheet .mud-dialog-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--yb-space-3);
  padding: 10px var(--yb-space-5) var(--yb-space-2);
}

.yb-action-sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-border-strong);
}

.yb-action-sheet__title {
  align-self: flex-start;
  font-size: var(--yb-text-title-3);
  font-weight: var(--yb-weight-strong);
}

.yb-action-sheet .yb-action-sheet__content.mud-dialog-content {
  padding: 0 var(--yb-space-3) var(--yb-space-4);
}

.yb-action-sheet__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.yb-action-sheet__item {
  display: flex;
  align-items: center;
  gap: var(--yb-space-3);
  min-height: 56px;
  padding: 0 var(--yb-space-2);
  border-radius: var(--yb-radius-md);
  color: var(--yb-text);
  font-weight: var(--yb-weight-medium);
  text-decoration: none;
}

button.yb-action-sheet__item {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-weight: var(--yb-weight-medium);
  text-align: start;
  cursor: pointer;
}

/* "Installer l'app" on iPhone, iPad and Safari on a Mac: the steps, with the icons the user will see. */
.yb-install-dialog__lead {
  margin: 0 0 var(--yb-space-3);
  color: var(--yb-text-muted);
}

.yb-install-steps {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
  margin: 0;
  padding-left: 1.4em;
}

.yb-install-steps li {
  padding-left: var(--yb-space-1);
}

.yb-install-steps li > span {
  vertical-align: middle;
}

.yb-install-steps__icon.mud-icon-root {
  margin-left: var(--yb-space-2);
  color: var(--yb-primary);
  font-size: 1.25rem;
  vertical-align: middle;
}

.yb-action-sheet__item:hover,
.yb-action-sheet__item:active {
  background: var(--yb-hover);
  color: var(--yb-text);
}

.yb-action-sheet__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--yb-radius-md);
  background: var(--yb-primary-soft);
  color: var(--yb-on-primary-soft);
}

.yb-action-sheet__label {
  flex: 1;
}

.yb-action-sheet__chevron.mud-icon-root {
  color: var(--yb-text-muted);
}

/* ==========================================================================
   Authentication (static SSR): illustration | form
   ========================================================================== */
.yb-auth {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: 100dvh;
  background: var(--yb-surface);
}

.yb-auth__art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--yb-space-8);
  padding: var(--yb-space-10);
  overflow: hidden;
  background: var(--yb-brand-surface);
  color: var(--yb-on-brand);
}

/* A link back to the home page: only the logo is clickable, not the whole width of the panel. */
.yb-auth__art-logo {
  align-self: flex-start;
}

.yb-auth__art-logo .yb-logo__wordmark {
  color: var(--yb-on-brand);
}

.yb-auth__scene {
  position: relative;
  align-self: center;
  width: min(320px, 80%);
}

.yb-auth__sheet {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-5);
  padding: var(--yb-space-6) var(--yb-space-6) var(--yb-space-5);
  border-radius: var(--yb-radius-sm);
  background: var(--yb-surface);
  box-shadow: var(--yb-shadow-lg);
  transform: rotate(-3deg);
}

.yb-auth__sheet-head,
.yb-auth__rows,
.yb-auth__slip-lines {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-2);
}

.yb-auth__line,
.yb-auth__rows span {
  display: block;
  height: 6px;
  border-radius: var(--yb-radius-pill);
  background: var(--yb-border);
}

.yb-auth__line--strong {
  width: 46%;
  height: 8px;
  background: var(--yb-primary);
}

.yb-auth__line--short {
  width: 38%;
}

.yb-auth__rows span:nth-child(2) {
  width: 84%;
}

.yb-auth__rows span:nth-child(3) {
  width: 62%;
}

.yb-auth__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-4);
  color: var(--yb-text);
}

.yb-auth__total .yb-auth__line {
  width: 30%;
}

.yb-auth__perforation {
  --yb-perforation-color: var(--yb-border-strong);
  margin: 0 calc(-1 * var(--yb-space-6));
}

.yb-auth__perforation .yb-perforation__scissors {
  color: var(--yb-text-muted);
  background: var(--yb-surface);
}

.yb-auth__slip {
  display: flex;
  align-items: center;
  gap: var(--yb-space-4);
}

.yb-auth__slip-lines {
  flex: 1;
}

/* A simple real QR code (25 modules, Swiss cross, leads to yodabill.ch): a drawn pattern read as fake, the full QR-bill as busy. */
.yb-auth__qr {
  display: block;
  flex: none;
  width: 64px;
  height: 64px;
}

.yb-auth__stamp {
  position: absolute;
  right: -22px;
  bottom: 6%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border: 3px solid var(--yb-brand-surface);
  border-radius: 50%;
  background: var(--yb-accent);
  color: var(--yb-on-accent);
  box-shadow: 0 0 0 3px var(--yb-accent);
  transform: rotate(-12deg);
}

.yb-auth__stamp .mud-icon-root {
  font-size: 36px;
}

.yb-auth__claim {
  max-width: 24ch;
  font-size: var(--yb-text-title-1);
  font-weight: var(--yb-weight-title-1);
  line-height: var(--yb-leading-title-1);
  letter-spacing: var(--yb-tracking-title-1);
}

.yb-auth__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--yb-space-8);
  padding: var(--yb-space-10) var(--yb-space-6) var(--yb-space-6);
}

.yb-auth__form {
  display: flex;
  flex-direction: column;
  width: min(380px, 100%);
  margin-top: auto;
}

.yb-auth__form .yb-auth__logo {
  display: none;
}

.yb-auth__title {
  margin-bottom: var(--yb-space-2);
}

.yb-auth__subtitle {
  margin-bottom: var(--yb-space-8);
  color: var(--yb-text-muted);
}

.yb-auth__fields {
  display: flex;
  flex-direction: column;
  gap: var(--yb-space-5);
}

.yb-auth__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--yb-space-2);
}

.yb-auth__link {
  font-weight: var(--yb-weight-medium);
}

.yb-auth__alt {
  margin-top: var(--yb-space-6);
  color: var(--yb-text-muted);
  text-align: center;
}

.yb-auth__alt a {
  font-weight: var(--yb-weight-medium);
}

.yb-auth__footer {
  display: flex;
  gap: var(--yb-space-5);
  margin-top: auto;
  font-size: var(--yb-text-caption);
}

.yb-auth__footer a {
  color: var(--yb-text-muted);
  text-decoration: none;
}

.yb-auth__footer a:hover {
  color: var(--yb-text);
}

@media (max-width: 959px) {
  .yb-auth {
    grid-template-columns: 1fr;
  }

  .yb-auth__art {
    display: none;
  }

  .yb-auth__panel {
    justify-content: flex-start;
    padding: var(--yb-space-6) var(--yb-space-4);
  }

  .yb-auth__form {
    margin-top: 0;
  }

  .yb-auth__form .yb-auth__logo {
    display: inline-flex;
    align-self: flex-start;
    justify-self: start;
    margin-bottom: var(--yb-space-8);
  }
}

/* ==========================================================================
   Empty layout
   ========================================================================== */
.yb-empty-layout {
  min-height: 100dvh;
  background: var(--yb-bg);
}

.yb-empty-layout:focus {
  outline: none;
}

.yb-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--yb-space-6);
  min-height: 100dvh;
  padding: var(--yb-space-6) var(--yb-space-4);
}

/* Visibility helpers by breakpoint (same thresholds as the shell). */
@media (max-width: 767px) {
  .yb-hide-phone {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .yb-show-phone {
    display: none !important;
  }
}

/* Read-only members: no "+" in the phone navigation, four entries share the bar (lot 19). */
.yb-bottomnav[data-create="none"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
