/**
 * Left Rail Flyouts (Transform / Align / Layer Order / Project)
 *
 * One-shot action pickers positioned next to the rail by
 * LeftRailComponent.positionFlyout() - not draggable or persistent,
 * unlike the Layers panel. Reuses the existing .tool-button row styling
 * from styles.css; only the floating container + the align grid layout
 * are new here.
 */

.rail-flyout {
  position: fixed;
  width: 208px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--s2h-shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.18));
  padding: 6px;
  /* Must clear the ruler's z-index: 99999 !important (studio.php) or the
     ruler tick marks render through the flyout. */
  z-index: 100000;
}

.rail-flyout[hidden] {
  display: none;
}

.rail-flyout .s2h-menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line, rgba(0, 0, 0, 0.1));
}

.rail-flyout-grid {
  width: 250px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rail-flyout-grid .tool-button {
  aspect-ratio: 1;
  width: 100%;
  height: auto;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  border-radius: 9px;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 4px 2px;
}

.rail-flyout-grid .tool-button .material-symbols-outlined {
  font-size: 22px;
}

.rail-flyout-grid .tool-button-label {
  font-size: 11px;
  white-space: nowrap;
  flex: none;
}

/* Rail trigger button shows an active state while its flyout is open */
[data-rail-flyout].active {
  background: #e8def8;
}

.rail-mobile-preview {
  display: none;
}

@media (max-width: 600px) {
  .rail-mobile-preview {
    display: block;
  }

  body.studio2-page .fullscreen-studio .icon-toolbar {
    display: flex !important;
    position: fixed !important;
    top: 52px !important;
    bottom: 0 !important;
    height: auto !important;
    max-height: none !important;
    box-sizing: border-box;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 60;
  }
}
