/* Shared application chrome. Load after each page's stylesheet. */
@font-face {
  font-family: Inter;
  src: url("/assets/assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
body.has-app-rail .app-topbar {
  position: relative;
  z-index: 100;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 50px;
  min-height: 50px;
  min-width: 0;
  padding: 0 16px;
  border-bottom: 1px solid #27272a;
  background: #09090b;
  color: #fafafa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 18px;
  color-scheme: dark;
}
.app-topbar *, .topbar-menu, .topbar-menu * { box-sizing: border-box; }
.app-topbar button, .topbar-menu button { font: inherit; }
.app-topbar button, .app-topbar a, .topbar-menu a { -webkit-tap-highlight-color: transparent; }
.app-topbar svg, .topbar-menu svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 1.7;
}
.app-topbar :is(button, a):focus-visible {
  outline: 2px solid #f4b942;
  outline-offset: 2px;
}
.app-topbar .app-topnav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}
.app-topbar .topnav-brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  height: 32px;
  color: #fafafa;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.app-topbar .topnav-brand img { width: 26px; height: 26px; border-radius: 6px; }
.app-topbar .topnav-links { display: flex; min-width: 0; align-items: center; gap: 4px; }
.app-topbar :is(.topnav-link, .topbar-more, .topbar-switch) {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.app-topbar .topnav-icon { display: inline-flex; flex-shrink: 0; align-items: center; }
.app-topbar :is(.topnav-link, .topbar-more, .topbar-switch):hover {
  background: #18181b;
  color: #fafafa;
}
.app-topbar :is(.topnav-link, .topbar-more)[aria-current="page"],
.app-topbar :is(.topnav-link, .topbar-more).active,
.app-topbar .topbar-switch {
  border-color: #493921;
  background: #211c12;
  color: #f4b942;
}
.app-topbar .topbar-switch { display: none; max-width: 100%; }
.app-topbar .topbar-switch > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .global-actions {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.app-topbar .reload-button, .app-topbar .status-pill { flex-shrink: 0; width: 32px; min-width: 32px; height: 32px; }
.app-topbar .status-tip { max-width: min(360px, calc(100vw - 24px)); line-height: 18px; white-space: normal; overflow-wrap: anywhere; }
.app-topbar .user-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  max-width: 208px;
  height: 34px;
  padding: 0 8px 0 5px;
  border: 1px solid #27272a;
  border-radius: 6px;
  background: #101014;
  color: #fafafa;
  text-align: left;
  cursor: pointer;
}
.app-topbar .user-chip:hover, .app-topbar .user-chip[data-state="open"] { background: #18181b; border-color: #3f3f46; }
.app-topbar .user-chip:disabled { opacity: .55; cursor: default; }
.app-topbar .user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1px solid #493921;
  border-radius: 50%;
  background: #211c12;
  color: #f4b942;
  font-size: 11px;
  font-weight: 650;
}
.app-topbar .user-copy { display: grid; min-width: 0; gap: 1px; line-height: 13px; text-align: left; }
.app-topbar .user-copy strong, .app-topbar .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar .user-copy strong { font-size: 12px; font-weight: 550; }
.app-topbar .user-copy small { color: #a1a1aa; font-size: 10px; font-variant-numeric: tabular-nums; }
.app-topbar .user-caret { display: inline-flex; flex-shrink: 0; color: #a1a1aa; }
.app-topbar svg.user-caret { width: 14px; height: 14px; }
.app-topbar .sign-in-button { height: 34px; min-width: 0; gap: 6px; padding: 0 10px; white-space: nowrap; font-size: 12px; }
.app-topbar .sign-in-glyph { width: 16px; height: 16px; }
.topbar-menu {
  z-index: 1000;
  width: 232px;
  max-width: calc(100vw - 16px);
  max-height: min(440px, var(--radix-dropdown-menu-content-available-height, calc(100dvh - 16px)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid #27272a;
  border-radius: 8px;
  background: #141418;
  color: #fafafa;
  box-shadow: 0 12px 36px #0008;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 18px;
  color-scheme: dark;
}
.topbar-menu.user-dropdown { width: 272px; }
.topbar-menu .topbar-menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  width: 100%;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d4d4d8;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  user-select: none;
}
.topbar-menu .topbar-menu-item > span:not(.menu-item-indicator) { min-width: 0; overflow-wrap: anywhere; }
.topbar-menu .topbar-menu-item[data-highlighted], .topbar-menu .topbar-menu-item[data-state="open"] { background: #27272a; color: #fafafa; }
.topbar-menu .topbar-menu-item[aria-current="page"], .topbar-menu .topbar-menu-item[data-state="checked"] { color: #f4b942; }
.topbar-menu .topbar-menu-item[data-disabled] { opacity: .45; cursor: default; }
.topbar-menu .topbar-menu-item > svg:last-child:not(:first-child) { margin-left: auto; }
.topbar-menu .menu-item-indicator { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; margin-left: auto; }
.topbar-menu .topbar-menu-separator { height: 1px; margin: 5px -5px; background: #27272a; }
.topbar-menu .topbar-menu-heading, .topbar-menu .user-dropdown-heading { display: grid; min-width: 0; gap: 4px; padding: 9px 8px 10px; }
.topbar-menu .user-dropdown-heading strong { font-size: 12px; font-weight: 600; }
.topbar-menu .user-dropdown-heading span { color: #a1a1aa; font-size: 11px; }
.topbar-menu .user-dropdown-heading strong, .topbar-menu .user-dropdown-heading span { min-width: 0; overflow-wrap: anywhere; }
.topbar-menu .topbar-sign-out { color: #f87171; }
.topbar-menu .topbar-sign-out[data-highlighted] { background: #351c20; color: #fca5a5; }
.app-topbar .topbar-error {
  position: absolute;
  top: 100%;
  right: 8px;
  z-index: 101;
  width: max-content;
  max-width: min(480px, calc(100vw - 16px));
  padding: 9px 12px;
  border: 1px solid #7f3036;
  border-radius: 0 0 6px 6px;
  background: #291518;
  color: #fecaca;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 24px #0006;
}
/* Keep translated navigation clear of long account names at the desktop threshold. */
@media (min-width: 1100px) and (max-width: 1279px) {
  .app-topbar .user-chip { max-width: 160px; }
  .app-topbar .app-topnav { gap: 16px; }
}
@media (max-width: 1099px) {
  .app-topbar .topnav-links { display: none; }
  .app-topbar .topbar-switch { display: inline-flex; }
  .app-topbar .app-topnav { gap: 12px; }
}
@media (max-width: 600px) {
  body.has-app-rail .app-topbar { padding: 0 8px; gap: 8px; }
  .app-topbar .app-topnav { gap: 8px; }
  .app-topbar .topnav-brand { width: 28px; height: 40px; }
  .app-topbar .topnav-brand > span { display: none; }
  .app-topbar .topbar-switch { height: 40px; padding: 0 8px; gap: 6px; flex-shrink: 1; }
  .app-topbar .global-actions { gap: 4px; }
  .app-topbar .user-chip { width: 40px; height: 40px; max-width: 40px; padding: 0; justify-content: center; }
  .app-topbar .user-copy, .app-topbar .user-caret { display: none; }
  .app-topbar .reload-button { width: 40px; min-width: 40px; height: 40px; }
  .app-topbar .status-pill { width: 20px; min-width: 20px; height: 32px; border-color: transparent; background: transparent; }
  .app-topbar .sign-in-button { max-width: 132px; height: 40px; padding: 0 8px; font-size: 11px; }
  .app-topbar .sign-in-button > span { overflow: hidden; text-overflow: ellipsis; }
  .topbar-menu .topbar-menu-item { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-topbar *, .topbar-menu * { transition: none; animation-duration: 0s; }
}

body.has-app-rail.embedded-page-shell .app-topbar { display: none; }
