/* Shared first-row notes strip for every CRM page with the moving ticker. */
body.global-notes-header-enabled .topbar {
  display: none !important;
}

body.global-notes-header-enabled .global-notes-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: calc(100% - 20px);
  min-width: 0;
  margin: 8px 10px 0;
}

body.global-notes-header-enabled .global-announcement-banner-slot:empty {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

body.global-notes-header-enabled .global-announcement-banner-slot:not(:empty) {
  display: block;
  width: calc(100% - 20px);
  min-width: 0;
  margin: 10px 10px 0;
  overflow: hidden;
  border: 1px solid rgba(16, 39, 70, .1);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16, 39, 70, .07);
}

body.global-notes-header-enabled .global-announcement-banner-slot img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

body.global-notes-header-enabled .app-shell,
body.global-notes-header-enabled .main-content {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}

/* The legacy topbar remains in the DOM but is hidden above. Clear its old
   reserved vertical spacing without changing the workspace's grid layout. */
body.global-notes-header-enabled .app-shell {
  min-height: 0 !important;
}

body.global-notes-header-enabled .main-content {
  margin-block: 0 !important;
  padding-top: 0 !important;
  padding-block-start: 0 !important;
  row-gap: 0 !important;
}

body.global-notes-header-enabled .main-content > .content-section {
  margin-block-start: 0 !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-block-start: 0 !important;
}

body.global-notes-header-enabled #clientsNotesTickerMount,
body.global-notes-header-enabled #clientsNotesBoard {
  min-width: 0;
  width: 100%;
}

body.global-notes-header-enabled .clients-notes-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  min-width: 0;
  margin: 0;
  padding: 7px 12px;
  overflow: hidden;
  border: 1px solid rgba(16, 39, 70, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 7px 18px rgba(16, 39, 70, .06);
}

body.global-notes-header-enabled .clients-notes-ticker-label {
  flex: 0 0 auto;
  color: #102746;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

body.global-notes-header-enabled .clients-notes-ticker-empty-copy {
  min-width: 0;
  overflow: hidden;
  color: #65758a;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.global-notes-header-enabled .clients-notes-ticker-viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  direction: rtl;
}

body.global-notes-header-enabled .clients-notes-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  animation: clients-notes-ticker-scroll 34s linear infinite;
}

body.global-notes-header-enabled .clients-notes-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(520px, 70vw);
  padding: 6px 9px;
  border: 1px solid rgba(16, 39, 70, .09);
  border-radius: 10px;
  background: #fff;
}

body.global-notes-header-enabled .clients-notes-ticker-text {
  max-width: 360px;
  overflow: hidden;
  color: #102746;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.global-notes-header-enabled .clients-notes-ticker-done {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: #102746;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 800;
}

body.global-notes-header-enabled .clients-notes-services-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid rgba(16, 39, 70, .12);
  border-radius: 999px;
  color: #102746;
  background: #f4f8fc;
  cursor: pointer;
  font-size: .74rem;
  font-weight: 800;
  white-space: nowrap;
}

body.global-notes-header-enabled #topbarUtilityButtons {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

body.global-notes-header-enabled #topbarUtilityButtons > #langToggleBtn {
  position: static !important;
  min-height: 34px;
  margin: 0;
}

@media (max-width: 760px) {
  body.global-notes-header-enabled .global-notes-header {
    grid-template-columns: minmax(0, 1fr);
  }

  body.global-notes-header-enabled #topbarUtilityButtons {
    justify-content: flex-end;
  }

  body.global-notes-header-enabled .clients-notes-ticker {
    gap: 7px;
    min-height: 44px;
    padding: 6px 8px;
  }

  body.global-notes-header-enabled .clients-notes-services-btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: .68rem;
  }
}
