/* ============================================================================
   Folded rail groups (Layout/RailGroup.razor): one tile with the group's name under the
   icon, and its pages in a labelled list beside the rail.
   ========================================================================== */
.tms-rail-group { position: relative; flex: none; }

.tms-rail-btn.tms-rail-gtile {
  height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: 0; cursor: pointer; font: inherit; color: var(--tms-rail-text); font-size: 18px;
}
.tms-rail-glabel { font-size: 9.5px; font-weight: 650; letter-spacing: .02em; line-height: 1; }

.tms-rail-fly {
  position: absolute; left: 50px; top: -6px; min-width: 200px; max-height: calc(100vh - 20px); overflow-y: auto;
  background: var(--tms-rail-2); border: 1px solid rgba(255,255,255,.10); border-radius: var(--tms-r-lg);
  box-shadow: var(--tms-shadow-3); padding: 6px; z-index: calc(var(--tms-z-rail) + 5);
  display: flex; flex-direction: column; gap: 1px;
  opacity: 0; visibility: hidden; transform: translateX(-4px);
  transition: opacity .12s, transform .12s, visibility 0s .12s;
}
.tms-rail-group.up .tms-rail-fly { top: auto; bottom: -6px; }

/* Open on hover (mouse), keyboard focus inside, or a tap (is-open). The bridge stops the list
   closing while the pointer crosses the gap between the tile and the list. */
.tms-rail-group:hover .tms-rail-fly,
.tms-rail-group:focus-within .tms-rail-fly,
.tms-rail-group.is-open .tms-rail-fly { opacity: 1; visibility: visible; transform: none; transition: opacity .12s, transform .12s; }
.tms-rail-group::after { content: ""; position: absolute; left: 42px; top: 0; bottom: 0; width: 10px; }

.tms-rail-fly-h {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--tms-rail-text); padding: 6px 10px 4px;
}
.tms-rail-fly-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--tms-r);
  color: #fff; text-decoration: none; font-size: 13.5px; white-space: nowrap;
}
.tms-rail-fly-item:hover { background: var(--tms-rail-hover); text-decoration: none; color: #fff; }
.tms-rail-fly-item .tms-icon, .tms-rail-fly-item svg { color: var(--tms-rail-text); font-size: 16px; flex: none; }
.tms-rail-fly-item.active { background: var(--tms-rail-active-bg); color: var(--tms-rail-active-ink); box-shadow: inset 0 0 0 1px var(--tms-rail-active-line); }
.tms-rail-fly-item.active svg { color: var(--tms-rail-active-ink); }
.tms-rail-fly-count {
  margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700;
  background: var(--tms-rail-accent); color: var(--tms-rail-accent-ink); text-align: center;
}

/* A phone draws the rail as a bottom bar and never folds; the list has no place there. */
@media (max-width: 720px) {
  .tms-rail-fly { display: none; }
}
