.app-topbar-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--rst-z-topbar);
  width: 100%;
  height: var(--rst-topbar-h,64px);
  min-height: var(--rst-topbar-h,64px);
  margin: 0;
  padding: 0 max(14px,calc((100vw - var(--rst-content-max,1640px)) / 2));
  display: grid;
  grid-template-columns: minmax(140px,auto) minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  background: var(--rst-topbar-bg);
  border-bottom: 1px solid var(--rst-topbar-line);
  overflow: visible;
}

.app-topbar__brand {
  grid-column: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.app-topbar-main .app-product-logo {
  display: block;
  width: 156px;
  max-width: 34vw;
  height: auto;
  object-fit: contain;
}

.app-topbar__actions {
  grid-column: 3;
  position: relative;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
}

.notif-wrap {
  display: block;
  width: auto;
  height: auto;
}

.notif-btn,.user-pill {
  appearance: none;
  min-height: 44px;
  margin: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--rst-ui-line);
  border-radius: var(--rst-ui-radius-lg);
  background: var(--rst-ui-divider-soft);
  color: var(--rst-ui-text);
  box-shadow: none;
  cursor: pointer;
  line-height: 1;
  transition: transform var(--rst-motion-ui) var(--rst-motion-smooth), background var(--rst-motion-ui) var(--rst-motion-smooth), border-color var(--rst-motion-ui) var(--rst-motion-smooth);
}

.notif-btn {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
}

.user-pill {
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--rst-fw-display);
}

.notif-btn:hover,.user-pill:hover {
  transform: translateY(-1px);
  background: var(--rst-ui-line);
  border-color: var(--rst-ui-line-strong);
}

.user-pill:focus-visible {
  outline: 2px solid var(--rst-state-info-border);
  outline-offset: 3px;
}

/* SVG stroke rules for .notif-btn are handled by .btn-svg in base.css. */

.app-topbar__nav {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  justify-self: center;
  overflow: visible;
}

.app-nav-link {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--rst-ui-radius-md);
  background: transparent;
  color: var(--rst-ui-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: var(--rst-fw-bold);
  white-space: nowrap;
  letter-spacing: 0;
  cursor: pointer;
  transition: color var(--rst-motion-ui) var(--rst-motion-smooth), background var(--rst-motion-ui) var(--rst-motion-smooth), box-shadow var(--rst-motion-ui) var(--rst-motion-smooth), transform var(--rst-motion-ui) var(--rst-motion-smooth);
}

.app-nav-link__icon,
.app-nav-link__icon svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.app-nav-link__icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-nav-link:hover {
  color: var(--rst-ui-text);
  background: var(--rst-ui-section-row-hover);
  transform: translateY(-1px);
}

.app-nav-link.is-active {
  color: var(--rst-ui-text);
  background: var(--rst-state-selected-bg);
  box-shadow: inset 0 0 0 1px var(--rst-state-selected-border);
}

.app-nav-link.is-active .app-nav-link__icon {
  color: var(--module-accent,var(--rst-state-info-text));
}

.app-topbar__nav[hidden] {
  display: none;
}
body.has-app-chrome .app-topbar-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--rst-z-topbar);
  display: grid;
}

.app-topbar-main[hidden] {
  display: none;
}

body.has-app-chrome .app-shell {
  margin-top: var(--rst-topbar-h,64px);
}

@media (max-width: 980px) {
  .app-topbar-main {
    grid-template-columns: minmax(112px,auto) minmax(0,1fr) auto;
    gap: 10px;
  }

  .app-topbar-main .app-product-logo {
    width: 132px;
    max-width: 24vw;
  }

  .app-nav-link {
    padding-inline: 9px;
    gap: 0;
  }

  .app-nav-link__icon {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-topbar-main {
    padding-inline: 12px;
    grid-template-columns: minmax(96px,auto) minmax(0,1fr) auto;
    gap: 6px;
  }

  .app-topbar-main .app-product-logo {
    width: 112px;
    max-width: 22vw;
  }

  .app-topbar__actions {
    gap: 6px;
  }

  .notif-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .user-pill {
    max-width: 76px;
    min-height: 40px;
    padding-inline: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-nav-link {
    min-height: 34px;
    padding-inline: 7px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .app-topbar-main {
    grid-template-columns: minmax(82px,auto) minmax(0,1fr) auto;
    gap: 5px;
    padding-inline: 10px;
  }

  .app-topbar-main .app-product-logo {
    width: 96px;
    max-width: 21vw;
  }

  .app-topbar__nav {
    gap: 4px;
  }

  .app-nav-link {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    gap: 0;
  }

  .app-nav-link__icon {
    display: inline-flex;
  }

  .app-nav-link > span:not(.app-nav-link__icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}
