/*
 * Orbit's own chrome: the titlebar, the rail and the glow (Foundations › 02 Shell anatomy, Rail
 * 36:190, RailItem 36:188). Orbit Frame draws these. The package does not ship this file, because
 * Orbit owns the rail and the titlebar: runtime/scripts/bundle.mjs copies it from src. A rail item
 * is icon only: the name is its tooltip and its accessible name, never a visible label.
 */

.orbit-titlebar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: var(--orbit-shell-titlebar);
  padding: 0 12px 0 88px;
  background: rgb(24 23 27 / 0.8);
  color: rgb(255 255 255 / 0.55);
  font: 600 13px/16px var(--orbit-font-sans);
  -webkit-app-region: drag;
  -webkit-user-select: none;
  user-select: none;
}

/* The marks of the title (Orbit Frame's env and control words) come first and keep their width. Only
   the name is cut, so a long name never hides them. */
.orbit-titlebar-title {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: safe center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.orbit-titlebar-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orbit-titlebar button {
  -webkit-app-region: no-drag;
}

/* The glow sits in the window layer, under the rail and the panel. Never inside an app. */
.orbit-glow {
  position: absolute;
  top: -248px;
  left: -112px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: var(--orbit-color-bg-glow);
  filter: blur(140px);
  opacity: 0.15;
  pointer-events: none;
}

.orbit-rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: var(--orbit-shell-rail);
  padding: 12px 0 16px;
  -webkit-user-select: none;
  user-select: none;
}

.orbit-rail-apps {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.orbit-rail-divider {
  flex: none;
  width: 32px;
  height: 2px;
  border-radius: 1px;
  background: var(--orbit-color-bg-rail-item);
}

.orbit-rail-spacer {
  flex: 1;
}

.orbit-rail-item {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: var(--orbit-shell-rail);
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--orbit-color-text-on-rail-muted);
  cursor: pointer;
}

.orbit-rail-item:focus-visible {
  outline: none;
}

.orbit-rail-item:focus-visible .orbit-rail-tile {
  outline: 2px solid var(--orbit-color-border-focus);
  outline-offset: 2px;
}

.orbit-rail-tile-row {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  height: 44px;
}

.orbit-rail-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--orbit-primitive-white);
  transform: translateY(-50%);
  transition: height 120ms ease;
}

/* A running app that is not selected keeps a short indicator, as the Dock does. */
.orbit-rail-item[data-open] .orbit-rail-indicator { height: 8px; }
.orbit-rail-item:hover .orbit-rail-indicator { height: 20px; }
.orbit-rail-item[aria-current="page"] .orbit-rail-indicator { height: 36px; }

.orbit-rail-tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: var(--orbit-radius-md);
  background: var(--orbit-color-bg-rail-item);
  color: var(--orbit-color-text-on-rail);
  font: 600 16px/20px var(--orbit-font-sans);
  transition: background 120ms ease;
}

.orbit-rail-tile .orbit-icon {
  width: 20px;
  height: 20px;
}

.orbit-rail-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orbit-rail-item:hover .orbit-rail-tile {
  background: var(--orbit-color-bg-rail-item-hover);
}

.orbit-rail-item[aria-current="page"] .orbit-rail-tile {
  background: var(--orbit-color-bg-brand);
}

.orbit-rail-item:hover,
.orbit-rail-item[aria-current="page"] {
  color: var(--orbit-color-text-on-rail);
}

/* Home is a dark tile with the white globe, larger while Home is the page. It never takes the
   brand fill. */
.orbit-rail-item[data-kind="home"][aria-current="page"] .orbit-rail-tile {
  background: var(--orbit-color-bg-rail-item);
}

.orbit-rail-item[data-kind="home"] .orbit-rail-tile svg {
  width: 27px;
  height: 25px;
  transition: width 120ms ease, height 120ms ease;
}

.orbit-rail-item[data-kind="home"][aria-current="page"] .orbit-rail-tile svg {
  width: 36px;
  height: 33px;
}

.orbit-rail .orbit-globe-mark {
  fill: var(--orbit-color-text-on-rail);
}

.orbit-rail-item[data-kind="add"] .orbit-rail-tile,
.orbit-rail-item[data-kind="build"]:not([aria-current="page"]) .orbit-rail-tile {
  border: 1.5px dashed var(--orbit-color-text-on-rail-muted);
  background: none;
  color: var(--orbit-color-text-on-rail-muted);
}

.orbit-rail-item[data-kind="add"]:hover .orbit-rail-tile,
.orbit-rail-item[data-kind="build"]:not([aria-current="page"]):hover .orbit-rail-tile {
  border-style: solid;
  border-color: transparent;
  background: var(--orbit-color-bg-rail-item);
  color: var(--orbit-color-text-on-rail);
}

/* An update is ready. */
.orbit-rail-badge {
  position: absolute;
  top: -2px;
  left: 54px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--orbit-color-bg-rail);
  border-radius: 50%;
  background: var(--orbit-color-accent-pink);
  box-sizing: border-box;
}

.orbit-rail-avatar {
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.orbit-rail-avatar .orbit-avatar {
  width: 40px;
  height: 40px;
  font: 600 13px/16px var(--orbit-font-sans);
}
