/* Locked b6VOWZf42C rail. All colours are BAGUETTE KIT preset tokens. */
:root {
  --kit-sidebar: oklch(0.985 0.001 106.423);
  --kit-foreground: oklch(0.147 0.004 49.25);
  --kit-accent: oklch(0.97 0.001 106.424);
  --kit-accent-foreground: oklch(0.216 0.006 56.043);
  --kit-border: oklch(0.923 0.003 48.717);
  --kit-popover: oklch(1 0 0);
}

.dark {
  --kit-sidebar: oklch(0.216 0.006 56.043);
  --kit-foreground: oklch(0.985 0.001 106.423);
  --kit-accent: oklch(0.268 0.007 34.298);
  --kit-accent-foreground: oklch(0.985 0.001 106.423);
  --kit-border: oklch(1 0 0 / 10%);
  --kit-popover: oklch(0.216 0.006 56.043);
}

.baguette-icon-rail {
  width: 56px !important;
  min-width: 56px !important;
  padding: 8px !important;
  overflow: visible !important;
  border-color: var(--kit-border) !important;
  background: var(--kit-sidebar) !important;
}

.baguette-icon-rail > .baguette-rail-burger:first-child {
  flex: 0 0 40px !important;
}

/* M9 (Toufic, 5 Nov 2026): the shared baguette top bar already carries the
   one burger when framed by app.baguet(te)?app.com, so the app's own hides. */
html.baguette-framed .baguette-rail-burger {
  display: none !important;
}

/* K9 (Toufic, 5 Nov 2026): "we can not keep two" - the shared top bar's own
   light/dark control stays, so every framed app's own rail theme control
   hides. The baguette-theme message bridge keeps the app's theme in sync. */
html.baguette-framed .baguette-rail-theme,
html.baguette-framed #left-menu .baguette-rail-theme {
  display: none !important;
}

body.baguette-has-icon-rail {
  padding-left: 56px !important;
}

/* Gauzy: its fixed nb-sidebar and layout column sit right of the kit rail. */
body.baguette-has-icon-rail nb-sidebar.fixed,
body.baguette-has-icon-rail nb-sidebar .main-container-fixed {
  left: 56px !important;
}

body.baguette-has-icon-rail nb-layout .layout-container {
  padding-left: 0 !important;
}

/* Gauzy at phone width: its open nb-sidebar floats over the page from the
   rail edge instead of pushing it; the page keeps full width minus the rail
   and the kit 16px gutter. Gauzy's own toggle still opens and closes it. */
@media (max-width: 767px) {
  body.baguette-has-icon-rail nb-layout .layout-container nb-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 56px !important;
    z-index: 1000 !important;
  }

  body.baguette-has-icon-rail nb-layout .layout-container nb-layout-column {
    min-width: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

[data-baguette-app-rail].baguette-icon-rail {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  z-index: 1001 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  gap: 4px !important;
}

/* The Chat Inbox maker mark is 32px in the shipped skin. Its 2x mark needs
   the only wider shared rail; Social's app-owned rail is widened below. */
/* A 48px rail mark plus the required 16px clear space on both sides. */
aside.baguette-icon-rail:has(img[src*='/brand-assets/logo_thumbnail.svg' i]) {
  width: 80px !important;
  min-width: 80px !important;
}

#left-menu.baguette-icon-rail {
  width: 80px !important;
  min-width: 80px !important;
}

/* Social's original 80px shell already fits the 48px mark and 16px clearance. */
.flex.flex-col.bg-newBgColorInner.w-\[80px\]:has(> #left-menu.baguette-icon-rail) {
  width: 80px !important;
  min-width: 80px !important;
}

/* Chatwoot collapsed: nav > ul > li > div > a|button.
   Postiz: #left-menu > div > menu-column > a|button. */
.baguette-icon-rail > nav > ul > li > div > :is(a, button),
#left-menu.baguette-icon-rail > div > div > :is(a, button),
.baguette-rail-control {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  margin: 0 auto 4px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--kit-foreground) !important;
  font-size: 0 !important;
  line-height: 1 !important;
}

.baguette-icon-rail > nav > ul > li > div > :is(a, button):hover,
#left-menu.baguette-icon-rail > div > div > :is(a, button):hover,
.baguette-rail-control:hover {
  background: var(--kit-accent) !important;
  color: var(--kit-accent-foreground) !important;
}

/* Every rail click shows it landed (Toufic, 4 Nov 2026): embed-rail.js adds
   baguette-rail-pressed until the page moves; kit accent fill, a small press
   and a soft pulse while the app is still opening the page. */
.baguette-icon-rail .baguette-rail-pressed,
.baguette-rail-control.baguette-rail-pressed {
  background: var(--kit-accent) !important;
  color: var(--kit-accent-foreground) !important;
  transform: scale(0.94);
  animation: baguette-rail-busy 0.9s ease-in-out 0.25s infinite;
}
@keyframes baguette-rail-busy {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .baguette-icon-rail .baguette-rail-pressed,
  .baguette-rail-control.baguette-rail-pressed {
    animation: none;
  }
}

/* Chatwoot SidebarGroup applies bg-n-alpha-2 to the active collapsed route. */
.baguette-icon-rail > nav > ul > li > div > :is(a, button).bg-n-alpha-2 {
  background: var(--kit-accent) !important;
  color: var(--kit-accent-foreground) !important;
}

/* Postiz MenuItem applies bg-boxFocused to the active route. */
#left-menu.baguette-icon-rail > div > div > :is(a, button).bg-boxFocused {
  background: var(--kit-accent) !important;
  color: var(--kit-accent-foreground) !important;
}

.baguette-icon-rail > nav > ul > li > div > :is(a, button) > :not(svg),
#left-menu.baguette-icon-rail > div > div > :is(a, button) > :not(svg) {
  font-size: 0 !important;
}

.baguette-icon-rail svg,
.baguette-rail-control svg {
  width: 20px !important;
  height: 20px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Injected controls and app-owned rail items share the kit tooltip. */
.baguette-icon-rail [data-baguette-tooltip]::after {
  content: attr(data-baguette-tooltip);
  position: absolute;
  left: 48px;
  z-index: 2147483647;
  display: none;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid var(--kit-border);
  border-radius: 8px;
  background: var(--kit-popover);
  color: var(--kit-foreground);
  font: 500 14px Manrope, system-ui, sans-serif;
  box-shadow: 0 10px 15px -3px var(--kit-border);
}

.baguette-icon-rail [data-baguette-tooltip]:hover::after {
  display: block;
}

/* Social uses the body-owned tooltip below because Postiz clips local
   pseudo-elements. Keep the generic pseudo tooltip for Chatwoot only. */
#left-menu.baguette-icon-rail [data-baguette-tooltip]:is(:hover, :focus)::after {
  display: none !important;
}

/* Social's fixed Postiz rail clips a local pseudo-element. The companion
   script puts this single kit tooltip under body and positions it by icon. */
.baguette-social-tooltip {
  position: fixed;
  z-index: 2147483647;
  transform: translateY(-50%);
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 10px;
  border: 1px solid var(--kit-border);
  border-radius: 8px;
  background: var(--kit-popover);
  color: var(--kit-foreground);
  font: 500 14px Manrope, system-ui, sans-serif;
  box-shadow: 0 10px 15px -3px var(--kit-border);
}

/* Social's top bar carries the baguette burger at its far right; the bar's
   own gap spaces it, so the rail margin is dropped there. */
.text-textItemBlur > .baguette-rail-burger {
  margin: 0 !important;
  flex: 0 0 40px !important;
}

/* Social's brand list opens beside the rail's brand control, on the kit
   popover look, and lives under body so the fixed rail never clips it. */
.baguette-rail-popover {
  position: fixed;
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  padding: 8px;
  border: 1px solid var(--kit-border);
  border-radius: 8px;
  background: var(--kit-popover);
  color: var(--kit-foreground);
  font: 500 14px Manrope, system-ui, sans-serif;
  box-shadow: 0 10px 15px -3px var(--kit-border);
}

.baguette-rail-popover-current {
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--kit-border);
  color: var(--kit-muted-foreground);
  font-size: 12px;
}

.baguette-rail-popover-item {
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.baguette-rail-popover-item:is(:hover, :focus-visible) {
  background: var(--kit-accent);
  color: var(--kit-accent-foreground);
  outline: none;
}

/* Chatwoot teleports SidebarCollapsedPopover outside the rail. */
.fixed.z-\[100\].min-w-\[200px\] {
  border: 1px solid var(--kit-border) !important;
  border-radius: 8px !important;
  background: var(--kit-popover) !important;
  color: var(--kit-foreground) !important;
}

.fixed.z-\[100\].min-w-\[200px\] :is(a, button) {
  min-height: 32px !important;
  font: 500 14px Manrope, system-ui, sans-serif !important;
}
