.global-rail {
  --rail-bg: rgba(21, 34, 30, 0.94);
  position: fixed;
  z-index: 1200;
  left: 0;
  top: 50%;
  width: 52px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: var(--rail-bg);
  box-shadow: 0 18px 48px rgba(12, 28, 22, 0.24);
  backdrop-filter: blur(18px) saturate(1.2);
  transform: translate(calc(-100% + 11px), -50%);
  transition: width 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease;
  overflow: hidden;
  color: #f8fbf9;
}

.global-rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  width: 11px;
  height: 100%;
  border-radius: 0 17px 17px 0;
  background:
    linear-gradient(180deg, #dfff70, #87d9af) right center / 3px 64px no-repeat,
    var(--rail-bg);
  box-shadow: 0 0 18px rgba(178, 237, 118, 0.34);
  opacity: 1;
  transition: opacity 150ms ease;
}

.global-rail.is-revealed,
.global-rail:focus-within {
  transform: translate(0, -50%);
}

.global-rail.is-expanded,
.global-rail:focus-within {
  width: 174px;
  box-shadow: 0 22px 58px rgba(12, 28, 22, 0.3);
}

.global-rail.is-revealed::after,
.global-rail:focus-within::after { opacity: 0; }

.global-rail__brand,
.global-rail__link {
  width: 158px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 11px;
  color: rgba(246, 250, 248, 0.68);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.global-rail__brand {
  margin-bottom: 8px;
  color: #fff;
}

.global-rail__mark,
.global-rail__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
}

.global-rail__mark {
  border-radius: 11px;
  background: #dfff70;
  color: #17372d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 800;
}

.global-rail__brand span:last-child {
  display: grid;
  line-height: 1.05;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.global-rail__brand small {
  margin-top: 4px;
  color: rgba(246, 250, 248, 0.42);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.12em;
}

.global-rail__menu {
  display: grid;
  gap: 3px;
}

.global-rail__link:hover,
.global-rail__link:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
  transform: translateX(1px);
}

.global-rail__link.is-active {
  background: rgba(223, 255, 112, 0.14);
  color: #dfff70;
}

.global-rail__link.is-disabled {
  opacity: 0.28;
  cursor: not-allowed;
  filter: grayscale(1);
  pointer-events: none;
}

.global-rail__link.is-logout { margin-top: 3px; color: rgba(255, 255, 255, 0.58); }
body.access-pending-mode .global-rail__brand { cursor: default; }

.global-rail__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.global-rail__label {
  overflow: hidden;
  opacity: 0;
  transform: translateX(-5px);
  font-size: 13px;
  font-weight: 720;
  transition: opacity 140ms ease, transform 180ms ease;
}

.global-rail.is-expanded .global-rail__label,
.global-rail:focus-within .global-rail__label {
  opacity: 1;
  transform: translateX(0);
}

.global-rail__divider {
  width: 28px;
  height: 1px;
  margin: 6px 5px;
  background: rgba(255, 255, 255, 0.12);
  transition: width 220ms ease;
}

.global-rail.is-expanded .global-rail__divider,
.global-rail:focus-within .global-rail__divider { width: 148px; }

@media (max-width: 760px) {
  body { padding-bottom: 72px; }
  .global-rail,
  .global-rail.is-revealed,
  .global-rail.is-expanded,
  .global-rail:focus-within {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    padding: 5px;
    border-radius: 16px;
    transform: none;
    overflow-x: auto;
  }
  .global-rail::after { display: none; }
  .global-rail__brand,
  .global-rail__divider { display: none; }
  .global-rail__menu { display: flex; justify-content: space-around; min-width: 320px; }
  .global-rail__link { width: 52px; min-height: 48px; display: grid; place-items: center; gap: 0; }
  .global-rail__icon { width: 36px; height: 28px; }
  .global-rail__label,
  .global-rail.is-expanded .global-rail__label,
  .global-rail:focus-within .global-rail__label {
    max-width: 52px;
    opacity: 1;
    transform: none;
    font-size: 9px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-rail, .global-rail *, .global-rail *::before, .global-rail *::after { transition: none !important; }
}
