/* Barre latérale + modale — DA « Lin & Ardoise » */

@import url("/frontend/css/theme-b-tokens.css");

:root {
  /* DA référente Lin & Ardoise (pont --theme-b-*) */
  --theme-b-bg: #f1efe9;
  --theme-b-surface: #ffffff;
  --theme-b-subtle: #e9e6de;
  --theme-b-border: rgba(38, 42, 48, 0.12);
  --theme-b-border-strong: rgba(38, 42, 48, 0.22);
  --theme-b-text: #262a30;
  --theme-b-text-muted: rgba(38, 42, 48, 0.72);
  --theme-b-primary: #262a30;
  --theme-b-action: #5c7d97;
  --theme-b-action-hover: #4e6a80;
  --theme-b-on-action: #f6f7f8;
  --theme-b-accent-sage: #9c8b76;
  --theme-b-tag-border: rgba(38, 42, 48, 0.08);

  --shell-rail-w: 64px;
  --shell-rail-expanded: 232px;
  --shell-content-offset: calc(var(--shell-rail-w) + 1.5rem);
  --shell-bottom-nav-h: 0px;
  --shell-bg: var(--theme-b-bg);
  --shell-rail-bg: linear-gradient(
    180deg,
    color-mix(in srgb, var(--theme-b-surface) 96%, #ffffff) 0%,
    color-mix(in srgb, var(--theme-b-subtle) 90%, #ffffff) 100%
  );
  --shell-border: var(--theme-b-border);
  --shell-rail-edge: var(--theme-b-border);
  --shell-fg: var(--theme-b-text);
  --shell-muted: var(--theme-b-text-muted);
  --shell-accent: var(--theme-b-action);
  --shell-accent-soft: color-mix(in srgb, var(--theme-b-action) 18%, transparent);
  --shell-primary: var(--theme-b-primary);
  --shell-primary-soft: color-mix(in srgb, var(--theme-b-primary) 12%, transparent);
  --shell-z-mobile-backdrop: 49990;
  --shell-z-rail: 50000;
  --shell-z-mobile-toggle: 50020;
  --shell-z-modal-backdrop: 50030;
  --shell-z-modal: 50040;
}

body.da-global-background {
  background-color: var(--theme-b-bg);
  background-image:
    radial-gradient(circle at 10% 10%, rgba(92, 125, 151, 0.14) 0%, transparent 42%),
    radial-gradient(circle at 90% 30%, rgba(156, 139, 118, 0.1) 0%, transparent 40%),
    linear-gradient(140deg, #f4f2ec 0%, #eef2f6 52%, #f1efe9 100%);
  background-size: 100% 100%;
}

/* #region rail */

.controllBarContainer {
  display: flex;
  flex-direction: column;
  width: var(--shell-rail-w);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--shell-z-rail) !important;
  background: var(--shell-rail-bg);
  border-right: 1px solid var(--shell-rail-edge);
  box-shadow: 3px 0 18px rgba(38, 42, 48, 0.06);
  font-family: "Manrope", system-ui, sans-serif;
  transition:
    width 0.16s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.16s ease;
}

#controlbar-placeholder {
  position: relative !important;
  z-index: var(--shell-z-rail) !important;
}

.controllBarContainer:hover,
.controllBarContainer:focus-within {
  width: var(--shell-rail-expanded);
  box-shadow: 7px 0 30px rgba(38, 42, 48, 0.08);
}

/* Haut du rail : uniquement compte / connexion (railUser) — bordure bas = séparation nav */
.controllBarHeader {
  flex-shrink: 0;
  width: 100%;
  padding: 0.45rem 0.65rem 0.5rem 0.35rem;
  border-bottom: 1px solid var(--shell-rail-edge);
  box-sizing: border-box;
}

.controllBarNav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Header + nav (desktop = rail ; mobile = panneau coulissant) */
.shellRailDesktop {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.shellMobileNavBackdrop,
.shellMobileNavToggle {
  display: none;
}

/* Marque — logo site, toujours visible en tête du rail */
.shellRailBrand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  min-height: 56px;
  padding: 0.5rem 0.65rem 0.45rem 0.35rem;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--shell-rail-edge);
  transition:
    background 0.12s ease,
    transform 0.09s ease;
}

.shellRailBrand:hover {
  background: color-mix(in srgb, var(--theme-b-primary) 9%, var(--theme-b-subtle));
}

.shellRailBrand:active {
  transform: scale(0.99);
}

.shellRailBrand:focus-visible {
  outline: 2px solid var(--theme-b-action);
  outline-offset: -2px;
}

.shellRailBrand.is-active {
  background: color-mix(in srgb, var(--shell-accent) 10%, var(--theme-b-surface));
  box-shadow: inset 3px 0 0 var(--shell-accent);
}

.shellRailBrand.is-active .shellRailBrand__label {
  color: var(--shell-fg);
  font-weight: 700;
}

.shellRailBrand__logoWrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--theme-b-surface);
  border: 1px solid var(--theme-b-border);
  box-shadow:
    0 2px 8px rgba(38, 42, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.shellRailBrand:hover .shellRailBrand__logoWrap {
  border-color: color-mix(in srgb, var(--theme-b-primary) 28%, var(--theme-b-border));
}

.shellRailBrand__logo {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.shellRailBrand__label {
  font-size: 0.92rem;
  font-weight: 700;
  font-family: "League Spartan", system-ui, sans-serif;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Compte — cercle = même taille que les pastilles d’icônes (44px) */
.railUser {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
}

.railUser--connected {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  gap: 0.35rem;
  box-sizing: border-box;
}

.railUser__main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
  padding-right: 0;
  transition: padding-right 0.18s cubic-bezier(0.33, 1, 0.68, 1);
}

.railUser--connected:hover .railUser__main,
.railUser--connected:focus-within .railUser__main {
  padding-right: 40px;
}

/* Icône déconnexion — hors flux : disparition fluide (opacity + translate, pas max-width) */
.railUser__logout {
  position: absolute;
  right: 0;
  top: 50%;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.35rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--shell-muted);
  border-radius: 8px;
  opacity: 0;
  transform: translate(10px, -50%);
  pointer-events: none;
  transition:
    opacity 0.14s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.18s cubic-bezier(0.33, 1, 0.68, 1),
    color 0.11s ease;
}

.railUser__logoutIcon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.railUser--connected:hover .railUser__logout,
.railUser--connected:focus-within .railUser__logout {
  opacity: 1;
  transform: translate(0, -50%);
  pointer-events: auto;
}

.railUser--connected:hover .railUser__logout:hover {
  color: var(--theme-b-action);
}

.railUser__logout:focus-visible {
  opacity: 1;
  transform: translate(0, -50%);
  pointer-events: auto;
  outline: 2px solid var(--theme-b-action);
  outline-offset: 2px;
}

.railUser__avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--theme-b-on-action);
  background: var(--theme-b-action);
  letter-spacing: 0.02em;
  box-sizing: border-box;
}

.railUser__avatar--guest {
  color: var(--shell-muted);
  background: var(--theme-b-surface);
  border: 1px solid var(--theme-b-tag-border);
  font-size: 0.95rem;
  font-weight: 800;
}

.railUser__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.2;
}

.railUser__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--shell-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 168px;
}

.railUser__role {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--shell-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.railUser--guest {
  align-items: center;
}

.railUser__guestMeta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.railUser__guestLbl {
  font-size: 0.75rem;
  color: var(--shell-muted);
}

.railUser__link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--theme-b-action);
  text-decoration: none;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--theme-b-action) 35%, var(--theme-b-border));
  background: var(--theme-b-surface);
  transition: background 0.1s ease, border-color 0.1s ease;
}

.railUser__link:hover {
  background: var(--theme-b-subtle);
  border-color: var(--theme-b-action);
}

.controllBarContainerText {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--shell-fg);
  letter-spacing: -0.01em;
  transition:
    opacity 0.12s ease,
    max-width 0.16s cubic-bezier(0.4, 0, 0.2, 1);
}

.controllBarContainer:hover .controllBarContainerText,
.controllBarContainer:focus-within .controllBarContainerText {
  opacity: 1;
  max-width: 200px;
}

.itemContainer {
  appearance: none;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0 0.65rem 0 0.35rem;
  min-height: 52px;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  border-radius: 0 10px 10px 0;
  transition:
    background 0.1s ease,
    color 0.1s ease,
    transform 0.09s ease;
}

.itemContainer:hover {
  background: color-mix(in srgb, var(--theme-b-primary) 11%, var(--theme-b-subtle));
}

.itemContainer:active {
  transform: scale(0.98);
}

.itemContainer:focus-visible {
  outline: 2px solid var(--theme-b-action);
  outline-offset: 2px;
}

.itemContainer.is-active {
  background: color-mix(in srgb, var(--shell-accent) 15%, var(--theme-b-surface));
  box-shadow: inset 3px 0 0 var(--shell-accent);
}

.itemContainer.is-active .controllBarContainerText {
  color: var(--shell-fg);
  font-weight: 700;
}

.itemContainer--admin.is-active,
.itemContainer--framework.is-active {
  background: color-mix(in srgb, var(--shell-primary) 14%, var(--theme-b-surface));
  box-shadow: inset 3px 0 0 var(--shell-primary);
}

.itemContainer__iconWrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--theme-b-surface);
  border: 1px solid var(--theme-b-border);
  box-shadow:
    0 2px 8px rgba(38, 42, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.itemContainer:hover .itemContainer__iconWrap {
  background: var(--theme-b-surface);
  border-color: color-mix(in srgb, var(--theme-b-primary) 28%, var(--theme-b-border));
}

/* Tracés SVG : brun primaire au repos → vert sauge (nuancier) au survol */
.itemContainer__svgIcon {
  width: 22px;
  height: 22px;
  color: var(--theme-b-primary);
  transition: color 0.14s ease;
}

.itemContainer:hover .itemContainer__svgIcon {
  color: var(--theme-b-action);
}

.itemContainer img {
  display: block;
  width: auto;
  height: auto;
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
}

/*
 * DA référence (rail type frameworkAdmin) — desktop uniquement pour ne pas casser
 * le dock mobile (wrapper transparent). Même rendu pour tout shell dans #controlbar-placeholder.
 */
@media (min-width: 769px) {
  #controlbar-placeholder .controllBarContainer {
    background: rgba(255, 251, 248, 0.98);
    border-right-color: color-mix(in srgb, #745764 22%, var(--theme-b-border));
    box-shadow: 4px 0 24px rgba(95, 67, 80, 0.12);
    left: 8px;
    top: 8px;
    bottom: 8px;
    min-height: calc(100vh - 16px);
    border-radius: 14px;
    overflow: hidden;
  }

  #controlbar-placeholder .controllBarHeader {
    padding: 0.45rem 0.58rem 0.5rem;
  }

  #controlbar-placeholder .itemContainer {
    justify-content: flex-start;
    padding: 0 0.58rem;
  }

  #controlbar-placeholder .railUser__avatar {
    margin-left: 0.125rem;
  }
}

/* Avatar : couleurs alignées DA Lin & Ardoise */
#controlbar-placeholder .railUser__avatar {
  color: var(--theme-b-on-action);
  background: var(--theme-b-action);
}

#controlbar-placeholder .railUser__avatar.railUser__avatar--guest {
  color: var(--theme-b-text-muted);
  background: var(--theme-b-surface);
  border: 1px solid var(--theme-b-border);
}

#controlbar-placeholder .itemContainer:hover .itemContainer__svgIcon,
#controlbar-placeholder .itemContainer:focus-visible .itemContainer__svgIcon {
  color: var(--theme-b-action);
}

#controlbar-placeholder .itemContainer:hover .controllBarContainerText,
#controlbar-placeholder .itemContainer:focus-visible .controllBarContainerText {
  color: var(--theme-b-text);
}

/* #endregion rail */

/* #region modal settings */

.settingsBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--shell-z-modal-backdrop);
  background: rgba(38, 22, 31, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.settingsBackdrop.is-visible {
  display: block;
}

.settings {
  display: none;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--shell-z-modal);
  width: min(92vw, 440px);
  max-height: min(88vh, 520px);
  overflow: auto;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.35rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--theme-b-surface) 90%, #ffffff);
  border: 1px solid var(--shell-border);
  box-shadow:
    0 22px 56px rgba(38, 42, 48, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.58) inset;
}

.settings.is-open {
  display: flex;
}

.closeButtonControllBar {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--shell-border);
  background: var(--theme-b-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--shell-muted);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.closeButtonControllBar:hover {
  background: color-mix(in srgb, var(--theme-b-action) 12%, var(--theme-b-subtle));
  color: var(--shell-fg);
}

.closeButtonControllBar:focus-visible {
  outline: 2px solid var(--theme-b-action);
  outline-offset: 2px;
}

#userPreference {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.25rem;
}

#userPreference h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--shell-fg);
  letter-spacing: -0.02em;
}

.settingsIntro {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--shell-muted);
}

.settingsSection {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--shell-border);
  background: color-mix(in srgb, var(--theme-b-subtle) 52%, var(--theme-b-surface));
}

.settingsSection__title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--shell-fg);
}

.settingsSection__intro {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.42;
  color: var(--shell-muted);
}

.settingsSection--synastase {
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
}

.settingsLegalLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.settingsLegalLinks a {
  font-size: 0.82rem;
  color: var(--shell-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.settingsLegalLinks a:hover {
  color: var(--shell-fg);
}

.platformContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: min(35vh, 18rem);
  overflow-y: auto;
  padding-right: 0.15rem;
  scrollbar-gutter: stable;
}

.platform-btn {
  flex: 1 1 auto;
  min-width: 100px;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--shell-border);
  border-radius: 999px;
  background: var(--theme-b-subtle);
  color: var(--shell-fg);
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.platform-btn:hover {
  background: var(--theme-b-surface);
  border-color: color-mix(in srgb, var(--theme-b-action) 38%, var(--theme-b-border));
}

.platform-btn:focus-visible {
  outline: 2px solid var(--theme-b-action);
  outline-offset: 2px;
}

.platform-btn.selected {
  background: linear-gradient(135deg, var(--theme-b-action), var(--theme-b-action-hover));
  border-color: var(--theme-b-action-hover);
  color: var(--theme-b-on-action);
  box-shadow: 0 9px 20px color-mix(in srgb, var(--theme-b-action) 36%, transparent);
}

.synastaseGrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
}

.synastaseSwatch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  min-height: 0;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--shell-border) 70%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 1px 2px rgba(58, 48, 38, 0.08);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.synastaseSwatch:hover {
  transform: scale(1.04);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    0 3px 10px rgba(58, 48, 38, 0.12);
}

.synastaseSwatch:focus-within {
  outline: 2px solid var(--theme-b-action);
  outline-offset: 2px;
}

.synastaseSwatch__num {
  position: relative;
  z-index: 0;
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.55),
    0 1px 3px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  user-select: none;
}

.synastaseSwatch__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.synastaseSwatch__input::-webkit-color-swatch-wrapper,
.synastaseSwatch__input::-webkit-color-swatch {
  padding: 0;
  border: none;
}

.synastaseSwatch__input::-moz-color-swatch {
  border: none;
}

body.controlbar-settings-open {
  overflow: hidden;
}

/* #endregion modal settings */

/* #region rail mobile — bouton Menu + panneau vertical (sans scroll horizontal) */

@media (max-width: 768px) {
  :root {
    /* Même retrait gauche / droite (zones sûres + minimum identique) */
    --shell-page-inline-pad: max(
      1.125rem,
      env(safe-area-inset-left),
      env(safe-area-inset-right)
    );
    --shell-content-offset: var(--shell-page-inline-pad);
    --shell-bottom-nav-h: 52px;
    /* Bande laissée libre sous le voile : pill Menu + marge (pas de flou / pas de hit sur la controlbar). */
    --shell-mobile-backdrop-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  html {
    overflow-x: hidden;
  }

  .shellMobileNavBackdrop,
  .shellMobileNavToggle {
    display: block;
  }

  .shellMobileNavToggle {
    display: inline-flex;
  }

  .controllBarContainer {
    width: 100%;
    min-height: 0;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    background: transparent;
    border: none;
    box-shadow: none;
    pointer-events: none;
  }

  .controllBarContainer > * {
    pointer-events: auto;
  }

  .shellRailDesktop {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--shell-z-rail);
    width: 100%;
    max-width: 100%;
    max-height: min(88dvh, 100dvh);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    flex-direction: column;
    background: var(--shell-rail-bg);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--shell-rail-edge);
    border-bottom: none;
    box-shadow: 0 -14px 44px rgba(38, 42, 48, 0.16);
    transform: translate3d(0, 100%, 0);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
  }

  body.shell-mobile-nav-open .shellRailDesktop {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }

  .shellMobileNavBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--shell-mobile-backdrop-bottom);
    z-index: var(--shell-z-mobile-backdrop);
    /* Pas de backdrop-filter : sur mobile il floute souvent tout l’empilement (rail + bouton Menu). */
    background: rgba(21, 16, 28, 0.62);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.16s ease,
      visibility 0.16s ease;
    pointer-events: none;
  }

  body.shell-mobile-nav-open .shellMobileNavBackdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .controllBarContainer:hover,
  .controllBarContainer:focus-within {
    width: 100%;
  }

  .controllBarHeader {
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
    padding: 0.55rem 0.75rem 0.5rem;
    border-bottom: 1px solid var(--shell-rail-edge);
    box-sizing: border-box;
  }

  .railUser__text {
    display: flex;
  }

  .railUser--connected:hover .railUser__main,
  .railUser--connected:focus-within .railUser__main {
    padding-right: 0;
  }

  .railUser--connected .railUser__logout {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    flex-shrink: 0;
  }

  .controllBarNav {
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.45rem 0.25rem 0.85rem;
    gap: 0.15rem;
    -webkit-overflow-scrolling: touch;
  }

  .controllBarContainer .controllBarContainerText {
    opacity: 1;
    max-width: min(100%, 220px);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .itemContainer {
    width: 100%;
    max-width: 100%;
    min-height: 50px;
    flex-shrink: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 0.65rem 0 0.35rem;
    border-radius: 0 12px 12px 0;
    box-sizing: border-box;
  }

  .itemContainer.is-active {
    box-shadow: inset 3px 0 0 var(--shell-accent);
  }

  .itemContainer--admin.is-active,
  .itemContainer--framework.is-active {
    box-shadow: inset 3px 0 0 var(--shell-primary);
  }

  .itemContainer__iconWrap {
    width: 44px;
    height: 44px;
  }

  .shellRailBrand {
    min-height: 54px;
    padding: 0.55rem 0.65rem 0.5rem 0.35rem;
  }

  .shellMobileNavToggle {
    position: fixed;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--shell-z-mobile-toggle);
    isolation: isolate;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 48px;
    padding: 0.4rem 1.15rem;
    margin: 0;
    border-radius: 999px;
    border: 1px solid var(--shell-rail-edge);
    background: var(--theme-b-surface);
    color: var(--shell-fg);
    box-shadow:
      0 8px 26px rgba(38, 42, 48, 0.16),
      0 1px 0 rgba(255, 255, 255, 0.9) inset;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    touch-action: manipulation;
    pointer-events: auto;
  }

  .shellMobileNavToggle__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: block;
  }

  .shellMobileNavToggle__icon--close {
    display: none;
  }

  body.shell-mobile-nav-open .shellMobileNavToggle__icon--menu {
    display: none;
  }

  body.shell-mobile-nav-open .shellMobileNavToggle__icon--close {
    display: block;
  }

  .shellMobileNavToggle:focus-visible {
    outline: 2px solid var(--shell-accent);
    outline-offset: 3px;
  }

  body.shell-mobile-nav-open {
    overflow: hidden;
  }

  body.shell-mobile-nav-open .shellMobileNavToggle {
    box-shadow:
      0 10px 32px rgba(38, 42, 48, 0.18),
      0 1px 0 rgba(255, 255, 255, 0.9) inset;
  }
}

/* #endregion rail mobile */

@media (prefers-reduced-motion: reduce) {
  body.da-global-background {
    animation: none;
  }

  .controllBarContainer,
  .controllBarContainerText,
  .railUser__main,
  .railUser__logout,
  .itemContainer__svgIcon {
    transition: none;
  }
}
