:root {
  --header-height: 68px;
  --cb-header-height: 68px;
}

.cb-top {
  overflow: visible;
  z-index: 1000;
}

.cb-top__in {
  display: grid;
  grid-template-columns:
    max-content
    minmax(170px, 205px)
    minmax(0, 1fr)
    max-content;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  height: auto;
  overflow: visible;
}

.cb-logo {
  flex: none;
  white-space: nowrap;
}

.cb-city-picker,
.cb-geo-picker {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.cb-geo-picker__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
}

.cb-nav {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
  column-gap: 18px;
  row-gap: 8px;
  position: relative;
  z-index: 1100;
}

.cb-nav__main a,
.cb-nav > a {
  flex: none;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 0;
}

.cb-nav__main a:hover,
.cb-nav > a:hover {
  color: #0b63d8;
}

.cb-nav__main {
  display: flex;
  align-items: center;
  column-gap: 18px;
  row-gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  flex: 1 1 auto;
}

.cb-nav.is-measuring .cb-nav-more.is-empty {
  display: block !important;
  visibility: visible !important;
}

.cb-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  white-space: nowrap;
}

.cb-header-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.cb-action-icon .cb-ds-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.cb-header-auth {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
}

.cb-actions__post,
.cb-actions .cb-btn--primary {
  flex: none;
  white-space: nowrap;
}

.cb-user {
  position: relative;
  display: inline-flex;
  flex: none;
}

.cb-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  display: none;
}

.cb-user-menu.open {
  display: block;
}

.cb-avatar-wrap {
  position: relative;
  display: inline-flex;
}

.cb-header-profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--cb-line, #e5eaf1);
  border-radius: 50%;
  background: #f6f8fb;
  color: #0f172a;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.cb-header-profile-btn__letter {
  font-size: 15px;
  text-transform: uppercase;
}

.cb-user-menu a.is-active {
  background: #eef6ff;
  color: #075bd8;
  font-weight: 800;
}

.cb-nav__main a {
  flex: none;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.cb-nav__main a:hover {
  color: #0b63d8;
}

.cb-action-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #0f172a;
  background: transparent;
  text-decoration: none;
}

.cb-action-icon:hover {
  background: #f1f5f9;
  color: #0b63d8;
}

.cb-action-icon__badge {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}

.cb-nav-more {
  position: relative;
  flex: none;
  margin-left: 12px;
  z-index: 1200;
}

.cb-nav-more[hidden],
.cb-nav-more.is-empty {
  display: none !important;
}

.cb-nav-more__btn {
  border: 0;
  background: #f3f6fa;
  color: #0f172a;
  border-radius: 12px;
  height: 38px;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  font-size: 15px;
}

.cb-nav-more__btn::after {
  content: "";
  display: inline-block;
  margin-left: 8px;
  vertical-align: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.cb-nav-more.open .cb-nav-more__btn {
  background: #eff6ff;
  color: #0b63d8;
}

.cb-nav-more__btn:hover,
.cb-nav-more__btn:focus-visible {
  background: #eff6ff;
  color: #0b63d8;
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.cb-nav-more__panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  min-width: 280px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
  z-index: 1300;
  pointer-events: auto;
}

.cb-nav-more.open .cb-nav-more__panel {
  display: block;
}

.cb-nav-more__panel a {
  display: block;
  padding: 12px 13px;
  border-radius: 12px;
  text-decoration: none !important;
  color: #0f172a;
}

.cb-nav-more__panel a:hover,
.cb-nav-more__panel a:focus-visible {
  background: #f2f7ff;
  outline: none;
  box-shadow: inset 0 0 0 2px #93c5fd;
}

.cb-nav-more__panel b {
  display: block;
  color: #0f172a;
  font-size: 14px;
}

.cb-nav-more__panel span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.cb-message-preview-toast {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 1300;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.cb-message-preview-toast__body {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.cb-message-preview-toast img,
.cb-message-preview-toast__photo-empty {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
}

.cb-message-preview-toast__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #0f172a;
}

.cb-message-preview-toast__subject,
.cb-message-preview-toast__text {
  display: block;
  color: #64748b;
  font-size: 13px;
}

.cb-message-preview-toast__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0b63d8;
  margin-top: 6px;
}

.cb-message-preview-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: #f1f5f9;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 1099px) {
  .cb-top__in {
    grid-template-columns: auto minmax(140px, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 10px;
  }

  .cb-logo {
    grid-column: 1;
    grid-row: 1;
  }

  .cb-city-picker,
  .cb-geo-picker {
    grid-column: 2;
    grid-row: 1;
  }

  .cb-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .cb-top .cb-nav {
    display: flex !important;
    grid-column: 1 / -1;
    grid-row: 2;
    order: unset;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 2px 6px;
    margin: 0 -2px;
    column-gap: 8px;
    row-gap: 8px;
    border-top: 1px solid #e8edf3;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  }

  .cb-top .cb-nav::-webkit-scrollbar {
    display: none;
  }

  .cb-nav__main {
    flex-wrap: nowrap;
    overflow: visible;
    column-gap: 8px;
    row-gap: 8px;
  }

  .cb-nav__main a,
  .cb-nav > a {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
  }

  .cb-nav__main a:hover,
  .cb-nav__main a:focus-visible,
  .cb-nav > a:hover,
  .cb-nav > a:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
  }

  .cb-nav-more__panel {
    right: auto;
    left: 0;
  }
}

@media (max-width: 760px) {
  .cb-actions__post {
    padding: 0 14px;
    font-size: 14px;
  }

  .cb-top__in {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 8px;
    row-gap: 8px;
    padding-top: 10px;
    padding-bottom: 8px;
    flex-wrap: unset !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .cb-top .cb-wrap.cb-top__in {
    max-width: 100%;
  }

  .cb-logo {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .cb-city-picker,
  .cb-geo-picker {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
  }

  .cb-actions {
    grid-column: 2;
    grid-row: 1;
    flex-shrink: 0;
    align-self: center;
    justify-self: end;
    max-width: calc(100% - 52px);
  }

  .cb-top .cb-nav {
    grid-row: 3;
  }

  .cb-header-auth {
    gap: 6px;
    display: flex !important;
  }

  .cb-header-auth .cb-btn--sm {
    min-height: 36px;
    padding: 0 11px;
    font-size: 13px;
    white-space: nowrap;
  }

  .cb-actions .cb-btn--primary {
    min-height: 38px;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .cb-geo-picker__btn {
    min-height: 38px;
    padding: 4px 28px 4px 10px;
    border-radius: 12px;
  }

  .cb-geo-picker__secondary {
    display: none;
  }

  .cb-geo-picker__primary {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  .cb-wrap,
  .cb-wrap--wide {
    padding-left: 12px;
    padding-right: 12px;
  }

  .cb-main {
    padding-top: 16px;
  }
}
