/* MitaBase Pro — a product of ETMITA · https://etmita.com
   Copyright © ETMITA. All rights reserved. */
/* public/sidebar.css — the sidebar v3 "the lit rail" (2026-09-17;
   markup + behavior in /js/shell/sidebar.js, emitted from
   src/features/shell/shell.sidebar.ts). Loaded AFTER style.css so it
   wins. The rail is ink in BOTH themes.

   What v3 is, in one breath: a deeper surface (three gradient layers,
   lime dawn at the top-start, a purple whisper at the bottom-end, a
   near-black floor), ONE plate that glides to the active station with
   the pin, a spotlight that follows it up the rail, stations that rise
   in once on boot, and hover that lifts the icon instead of painting a
   box. Tokens only for every colour; the alphas are white and black
   over ink, which no token names. Motion: --mb-ease-out and the rail's
   own settle curve, 150–420 ms, never a loop. */

/* the mount participates in .layout-body's flex as if it weren't there */
#app-sidebar-root { display: contents; }

.sidebar {
  /* the rail's own dials — one place, so the plate, the pin, the glow
     and the knob agree on where the road is and how fast things settle */
  --sb-w: 272px;
  --sb-w-rail: 76px;
  --sb-road-x: 18px;           /* the road's centre from the start edge */
  --sb-ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
  --sb-dur-glide: 420ms;
  --sb-line: rgba(255, 255, 255, 0.07);
  --sb-line-strong: rgba(255, 255, 255, 0.14);
  --sb-lift: rgba(255, 255, 255, 0.045);
  --sb-lime-12: color-mix(in srgb, var(--mb-lime) 12%, transparent);
  --sb-lime-22: color-mix(in srgb, var(--mb-lime) 22%, transparent);
  --sb-lime-35: color-mix(in srgb, var(--mb-lime) 35%, transparent);
  --sb-glow-y: 0px;            /* set by sidebar.js: the active station's centre */

  position: relative;
  z-index: var(--mb-z-sidebar);
  width: var(--sb-w);
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--mb-font-sans);
  color: var(--mb-ondark);
  isolation: isolate;
  overflow: visible;
  /* three layers: the dawn (lime, top-start), the whisper (purple,
     bottom-end), the surface (ink-2 at the top settling to near-black) */
  background:
    radial-gradient(130% 55% at 0% -10%, color-mix(in srgb, var(--mb-lime) 11%, transparent), transparent 62%),
    radial-gradient(90% 40% at 100% 108%, color-mix(in srgb, var(--mb-purple) 14%, transparent), transparent 60%),
    linear-gradient(172deg, var(--mb-ink-2) 0%, var(--mb-ink) 46%, color-mix(in srgb, var(--mb-ink) 62%, black) 100%);
  transition: width var(--sb-dur-glide) var(--sb-ease-settle);
}
html[lang="fa"] .sidebar { font-family: var(--mb-font-fa); }

/* a hairline of light along the top, the way a lit panel meets the ceiling */
.sidebar::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--sb-lime-35), var(--sb-line-strong) 45%, transparent);
  pointer-events: none;
  z-index: 1;
}
html[dir="rtl"] .sidebar::before { background: linear-gradient(270deg, var(--sb-lime-35), var(--sb-line-strong) 45%, transparent); }

/* the outer edge: a hairline that fades at both ends; the one-shot
   sweep on toggle is a lime highlight travelling down it, never a loop */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: 1px;
  background:
    linear-gradient(180deg, transparent, var(--sb-lime-35) 50%, transparent) 0 -100% / 100% 40% no-repeat,
    linear-gradient(180deg, transparent, var(--sb-line-strong) 30%, var(--sb-line-strong) 70%, transparent);
  pointer-events: none;
}
.sidebar.sweep::after { animation: sb-sweep 0.7s var(--sb-ease-settle); }
@keyframes sb-sweep {
  0% { background-position: 0 -100%, 0 0; }
  100% { background-position: 0 200%, 0 0; }
}

svg.sb-ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  position: relative;
  z-index: 1;
}

/* ── Head: OUR official lockup ─────────────────────────────────────── */
.sidebar-head {
  position: relative;
  padding: 20px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sb-fade 0.5s var(--mb-ease-out) both;
}
.sb-lockup { height: 55px; width: auto; align-self: flex-start; }
.sb-mark { display: none; height: 30px; width: auto; align-self: center; }
.sb-tagline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mb-font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--mb-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
/* the live dot: the panel is up. Lime, no pulse — a rail that breathes
   all day is one the eye learns to ignore */
.sb-tagline::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--mb-lime);
  box-shadow: 0 0 8px var(--sb-lime-35);
  flex: none;
}

/* ── The knob (collapse control, rides the outer edge) ─────────────── */
.sb-knob {
  position: absolute;
  top: 74px;
  inset-inline-end: -15px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--sb-line-strong);
  background: linear-gradient(180deg, var(--mb-ink-2), var(--mb-ink));
  color: var(--mb-lime);
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 var(--sb-line);
  transition: border-color var(--mb-dur-fast), transform var(--mb-dur-base) var(--sb-ease-settle), box-shadow var(--mb-dur-base);
}
.sb-knob:hover {
  border-color: var(--mb-lime-mid);
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--sb-lime-35), inset 0 1px 0 var(--sb-line);
}
.sb-knob:active { transform: scale(0.96); }
.sb-knob:focus-visible { outline: 2px solid var(--mb-lime); outline-offset: 2px; }
/* An arrow that points where the sidebar is going: ‹ to fold it away,
   › to bring it back. In RTL the sidebar sits on the other side, so the
   arrow mirrors with it. */
.sb-knob-svg { width: 16px; height: 16px; transition: transform var(--sb-dur-glide) var(--sb-ease-settle); }
.sidebar.collapsed .sb-knob-svg { transform: rotate(180deg); }
html[dir="rtl"] .sb-knob-svg { transform: rotate(180deg); }
html[dir="rtl"] .sidebar.collapsed .sb-knob-svg { transform: rotate(0deg); }

/* ── The road, the plate, the pin, the spotlight ───────────────────── */
.sidebar-section {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--sb-line-strong) transparent;
}
/* the dashed road runs under the icons' centre line, fading at both
   ends so it reads as a stretch of road, not a ruler */
.sidebar-section::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 10px;
  inset-inline-start: calc(var(--sb-road-x) - 1px);
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--sb-line-strong) 0 5px, transparent 5px 13px);
  -webkit-mask-image: linear-gradient(180deg, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(180deg, transparent, black 8%, black 92%, transparent);
  pointer-events: none;
}
/* the spotlight: a wide, soft lime glow that follows the active station
   up and down the rail (transform only — the compositor does the work) */
.sidebar-section::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: -40px;
  width: 220px;
  height: 180px;
  margin-top: -90px;
  border-radius: 999px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mb-lime) 16%, transparent), transparent 70%);
  transform: translateY(var(--sb-glow-y));
  transition: transform var(--sb-dur-glide) var(--sb-ease-settle);
  pointer-events: none;
  z-index: 0;
}
/* ONE plate under the active station: it glides there with the pin
   (transform + height set by sidebar.js). A lime edge on the road side,
   a hairline of light on top, and nothing else — the label and the icon
   sit on it */
.sb-plate {
  position: absolute;
  top: 0;
  inset-inline-start: 10px;
  inset-inline-end: 12px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--sb-lime-12), var(--sb-lift) 55%, transparent);
  box-shadow: inset 0 1px 0 var(--sb-line);
  transform: translateY(0);
  transition: transform var(--sb-dur-glide) var(--sb-ease-settle), height var(--sb-dur-glide) var(--sb-ease-settle), opacity var(--mb-dur-fast);
  pointer-events: none;
  z-index: 0;
}
html[dir="rtl"] .sb-plate { background: linear-gradient(270deg, var(--sb-lime-12), var(--sb-lift) 55%, transparent); }
.sb-plate.off { opacity: 0; }
/* ONE pin, riding the road to the active station (transform set by JS) */
.sb-pin {
  position: absolute;
  top: 0;
  inset-inline-start: calc(var(--sb-road-x) - 6px);
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 999px;
  background: var(--mb-lime);
  box-shadow: 0 0 0 4px var(--sb-lime-22), 0 0 18px var(--sb-lime-35);
  pointer-events: none;
  z-index: 2;
  transition: transform var(--sb-dur-glide) var(--sb-ease-settle), opacity var(--mb-dur-fast);
}
.sb-pin::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: var(--mb-ink);
}
.sb-pin.off { opacity: 0; }

/* section eyebrows: number, name, then a hairline that runs to the end */
.sb-sec-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 4px 5px 0;
  padding-inline-start: 26px;
  font-family: var(--mb-font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mb-muted);
  white-space: nowrap;
  animation: sb-fade 0.5s var(--mb-ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.sb-sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-inline-start: 4px;
  background: linear-gradient(90deg, var(--sb-line), transparent);
}
html[dir="rtl"] .sb-sec-label::after { background: linear-gradient(270deg, var(--sb-line), transparent); }
.sb-sec-no { color: var(--mb-faint); }
.sb-sec-label[data-sec="ops"] .sb-sec-no { color: var(--mb-lime); }
.sb-sec-label[data-sec="team"] .sb-sec-no { color: var(--mb-meter-amber); }
.sb-sec-label[data-sec="admin"] .sb-sec-no { color: var(--mb-purple); }

/* ── Stations ──────────────────────────────────────────────────────── */
/* A station this administrator was not given, and a heading over nothing
   (2026-09-17). [hidden] alone loses to .sidebar-btn's own display. */
.sidebar-btn[hidden], .sb-sec-label[hidden] { display: none !important; }
.sidebar-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  padding-inline-start: 26px;
  border: none;
  border-radius: 12px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mb-faint);
  cursor: pointer;
  text-align: start;
  white-space: nowrap;
  transition: color var(--mb-dur-fast);
  /* rises in once, each station a beat after the one above it */
  animation: sb-rise 0.42s var(--sb-ease-settle) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}
.sidebar-btn > span[data-i18n], .sidebar-btn > .sb-label {
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform var(--mb-dur-base) var(--sb-ease-settle), color var(--mb-dur-fast);
}
.sidebar-btn .sb-ic {
  color: var(--mb-muted);
  transition: color var(--mb-dur-fast), transform var(--mb-dur-base) var(--sb-ease-settle);
}
/* the halo: a soft lime disc behind the icon, lit on hover and on the
   active station — the same element as before, drawn quieter */
.sb-halo {
  position: absolute;
  inset-inline-start: 19px;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 999px;
  background: radial-gradient(closest-side, var(--sb-lime-22), transparent 74%);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity var(--mb-dur-base), transform var(--mb-dur-base) var(--sb-ease-settle);
  pointer-events: none;
}
.sidebar-btn:hover { color: #fff; }
.sidebar-btn:hover .sb-ic { color: var(--mb-ondark); transform: translateY(-1px) scale(1.08); }
.sidebar-btn:hover > span[data-i18n], .sidebar-btn:hover > .sb-label { transform: translateX(3px); }
html[dir="rtl"] .sidebar-btn:hover > span[data-i18n], html[dir="rtl"] .sidebar-btn:hover > .sb-label { transform: translateX(-3px); }
.sidebar-btn:hover .sb-halo { opacity: 1; transform: scale(1); }
.sidebar-btn:active .sb-ic { transform: translateY(0) scale(0.96); }
.sidebar-btn:focus-visible { outline: 2px solid var(--mb-lime); outline-offset: -2px; }
/* the active station: white label, lime icon, the plate underneath is
   the sliding element — the button itself paints nothing */
.sidebar-btn.active { color: #fff; }
.sidebar-btn.active .sb-ic { color: var(--mb-lime); filter: drop-shadow(0 0 6px var(--sb-lime-35)); }
.sidebar-btn.active .sb-halo { opacity: 1; transform: scale(1); }
.sidebar-btn.active > span[data-i18n] { transform: none; }

.sb-badge {
  margin-inline-start: auto;
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--mb-lime);
  color: var(--mb-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--mb-ink) 60%, transparent);
  font-family: var(--mb-font-mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  flex: none;
  position: relative;
  z-index: 1;
}
.sb-badge.pop { animation: sb-pop 0.3s var(--sb-ease-settle); }
@keyframes sb-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); background: var(--mb-lime-hover); }
  100% { transform: scale(1); }
}
.sb-badge.hidden { display: none !important; }

/* ── Footer: Pro banner + rows ─────────────────────────────────────── */
.sb-foot {
  position: relative;
  z-index: 1;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: sb-fade 0.6s var(--mb-ease-out) both;
  animation-delay: 240ms;
}
/* ── locked stations (2026-09-05) ────────────────────────────────────
   A module outside the plan keeps its place in the rail. It is dimmed,
   not removed: a nav that grows and shrinks with the plan teaches
   nobody what the product is, and a customer who cannot see that
   Zeiterfassung exists will never ask for it. The lock sits where the
   badge would, so nothing shifts when a plan changes. */
.sidebar-btn.is-locked { color: var(--mb-faint); }
.sidebar-btn.is-locked .sb-ic { opacity: .55; }
.sidebar-btn.is-locked:hover { color: var(--mb-ondark); }
.sb-badge.is-muted { display: none !important; }
.sb-lock { margin-inline-start: auto; display: inline-flex; opacity: .6; }
.sb-lock-ic { width: 13px; height: 13px; }
.sidebar.collapsed .sb-lock {
  position: absolute; top: 5px; inset-inline-end: 7px; margin: 0;
}

/* ── the close button on the upgrade box ─────────────────────────── */
/* Visible on the dark box (operator 2026-09-07: "there is no way to
   close it" — there was, in --mb-faint on ink). A small ringed button,
   the same on Basic and Pro; a click hides the box until the next login. */
.sb-pro-close {
  position: absolute; top: 7px; inset-inline-end: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--mb-ondark); cursor: pointer;
  transition: color var(--mb-dur-fast) var(--mb-ease-out), background-color var(--mb-dur-fast) var(--mb-ease-out), border-color var(--mb-dur-fast) var(--mb-ease-out);
}
.sb-pro-close:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; }
.sb-pro-close:focus-visible { outline: 2px solid var(--mb-lime); outline-offset: 1px; }
.sb-pro-x { width: 12px; height: 12px; }
/* The box is a flex column; the close button must not push the tag. */
.sb-pro-tag { padding-inline-end: 30px; }

/* Hidden means gone. The display rules below (and the collapsed variant)
   beat the UA's [hidden], which left a 24 px phantom box plus the footer
   gap on the top plan and after the X (2026-09-06). */
.sb-pro[hidden],
.sb-pro-mini[hidden],
.sidebar.collapsed .sb-pro-mini[hidden] { display: none !important; }

/* the upgrade box: a lime beam from the bottom-end corner over ink-2,
   a lime-alpha frame, and a hairline of light on top — no dot texture */
.sb-pro {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--sb-lime-22);
  background:
    radial-gradient(120% 100% at 100% 110%, var(--sb-lime-22), transparent 62%),
    linear-gradient(180deg, color-mix(in srgb, var(--mb-ink-2) 92%, white), var(--mb-ink-2));
  box-shadow: inset 0 1px 0 var(--sb-line);
  padding: 12px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-pro-tag { font-family: var(--mb-font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--mb-lime); }
.sb-pro-desc { font-size: 11.5px; font-weight: 500; line-height: 1.45; color: var(--mb-ondark); margin: 0; }
.sb-pro-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--mb-lime-hover), var(--mb-lime));
  color: var(--mb-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--sb-lime-22);
  transition: transform var(--mb-dur-fast) var(--sb-ease-settle), box-shadow var(--mb-dur-fast), filter var(--mb-dur-fast);
}
.sb-pro-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 22px var(--sb-lime-35); filter: brightness(1.04); }
.sb-pro-cta:active { transform: translateY(0) scale(0.98); box-shadow: 0 3px 10px var(--sb-lime-22); }
.sb-pro-cta .sb-ic { width: 13px; height: 13px; }
.sb-pro-mini {
  display: none;
  width: 40px;
  height: 40px;
  align-self: center;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--sb-lime-35);
  background: var(--sb-lime-12);
  color: var(--mb-lime);
  cursor: pointer;
  transition: background var(--mb-dur-fast), transform var(--mb-dur-fast) var(--sb-ease-settle);
}
.sb-pro-mini:hover { background: var(--sb-lime-22); transform: translateY(-1px); }

.sb-foot-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid var(--sb-line);
  padding-top: 6px;
}
.sb-foot-rows .sidebar-btn { font-size: 12.5px; min-height: 36px; padding: 6px 10px; padding-inline-start: 26px; animation: none; }
.sb-foot-rows .sb-ic { width: 15px; height: 15px; }
.sb-foot-rows .sb-halo { width: 26px; height: 26px; margin-top: -13px; }
/* a footer row that is the current page (Systemeinstellungen, Support)
   has no plate — the road ends above; a lime icon says where you are */
.sb-foot-rows .sidebar-btn.active { color: #fff; background: var(--sb-lift); }

/* official company mark — MitaBase is an ETMITA platform */
.sb-copy {
  padding-top: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  user-select: none;
}
.sb-copy-link { font-size: 10.5px; font-weight: 600; color: var(--mb-faint); text-decoration: none; transition: color var(--mb-dur-fast); }
.sb-copy-link:hover { color: var(--mb-lime); }
.sb-copy-meta { font-family: var(--mb-font-mono); font-size: 8.5px; font-weight: 500; letter-spacing: 0.14em; color: var(--mb-muted); }

/* ── the two entrances (once, on boot; never on a tab switch) ──────── */
@keyframes sb-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes sb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Collapsed rail (desktop) ──────────────────────────────────────── */
@media (min-width: 1024px) {
  .sidebar.collapsed { width: var(--sb-w-rail); }
  .sidebar.collapsed .sb-lockup,
  .sidebar.collapsed .sb-tagline,
  .sidebar.collapsed .sb-sec-label span[data-i18n],
  .sidebar.collapsed .sidebar-btn > span[data-i18n],
  /* the plan row drops data-i18n once it says "Ihr Plan: Plus" (the
     text is interpolated, not a key), so it needs a class of its own
     to fold — it stuck out of the collapsed rail (2026-09-13) */
  .sidebar.collapsed .sidebar-btn > .sb-label,
  .sidebar.collapsed .sb-pro,
  .sidebar.collapsed .sb-copy-link { display: none; }
  .sidebar.collapsed .sb-mark { display: block; }
  .sidebar.collapsed .sb-pro-mini { display: flex; }
  .sidebar.collapsed { --sb-road-x: 12px; }
  .sidebar.collapsed .sidebar-section::after { inset-inline-start: -72px; }
  .sidebar.collapsed .sb-plate { inset-inline-start: 8px; inset-inline-end: 8px; background: var(--sb-lime-12); }
  .sidebar.collapsed .sb-sec-label { justify-content: center; margin-inline: 0; padding-inline-start: 0; }
  .sidebar.collapsed .sb-sec-label::after { display: none; }
  .sidebar.collapsed .sidebar-btn { justify-content: center; padding: 10px 0 10px 8px; }
  .sidebar.collapsed .sb-halo { inset-inline-start: 50%; margin-inline-start: -12px; }
  .sidebar.collapsed .sb-badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 8px;
    min-width: 15px;
    padding: 0 4px;
    font-size: 8.5px;
    margin: 0;
  }
  .sidebar.collapsed .sb-copy-meta { font-size: 7.5px; letter-spacing: 0.04em; }
}

/* ── Mobile drawer ─────────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: var(--mb-z-backdrop);
}
.sidebar-backdrop.open { display: block; animation: sb-fade var(--mb-dur-base) var(--mb-ease-out) both; }
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 280px;
    max-width: 85vw;
    z-index: var(--mb-z-drawer);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    transition: transform var(--sb-dur-glide) var(--sb-ease-settle);
  }
  html[dir="ltr"] .sidebar:not(.open) { transform: translateX(-100%); }
  html[dir="rtl"] .sidebar:not(.open) { transform: translateX(100%); }
  .sb-knob { display: none; }
  .sidebar-btn { min-height: 44px; }
  .sidebar-btn, .sb-sec-label, .sidebar-head, .sb-foot { animation: none; }
}
@media (min-width: 1024px) {
  .sidebar-backdrop { display: none !important; }
}

/* ── Floating tooltip for the collapsed rail ───────────────────────── */
.sb-tooltip {
  position: fixed;
  z-index: var(--mb-z-tooltip);
  transform: translateY(-50%) translateX(-4px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 11px;
  border-radius: 9px;
  background: var(--mb-ink-2);
  border: 1px solid var(--sb-line-strong);
  color: #fff;
  font-family: var(--mb-font-sans);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 var(--sb-line);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--mb-dur-fast), transform var(--mb-dur-base) var(--sb-ease-settle);
}
html[lang="fa"] .sb-tooltip { font-family: var(--mb-font-fa); }
html[dir="rtl"] .sb-tooltip { transform: translateY(-50%) translateX(4px); }
.sb-tooltip.show { opacity: 1; transform: translateY(-50%) translateX(0); }
.sb-tooltip-kbd {
  font-family: var(--mb-font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--mb-lime);
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid var(--sb-lime-35);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar *, .sidebar::after, .sidebar::before, .sidebar-section::after, .sb-knob-svg, .sb-pin, .sb-plate {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
