/*
 * The top bar of tessairact|code: brand, the primary navigation of the whole surface and the page's
 * own actions on the right. One source for every page: the map pages (web/index.html, loaded after
 * styles.css) and the chat page both load this file from the chat's public static route.
 */
.topbar {
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-self: start;
  min-width: 0;
}

.brand-mark {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 111, 120, 0.36);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(0, 111, 120, 0.1), rgba(255, 255, 255, 0.76));
  box-shadow: inset 0 0 20px rgba(0, 111, 120, 0.08);
}

.brand-mark span {
  position: absolute;
  right: 7px;
  left: 7px;
  height: 2px;
  transform: skewY(-13deg);
  border-radius: 1px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 111, 120, 0.24);
}

.brand-mark span:nth-child(1) {
  top: 10px;
}

.brand-mark span:nth-child(2) {
  top: 17px;
  right: 11px;
}

.brand-mark span:nth-child(3) {
  top: 24px;
  left: 11px;
}

.topbar .eyebrow {
  margin: 0;
  color: var(--cyan);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.17em;
  line-height: 1.4;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 1px 0 0;
  line-height: normal;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.primary-navigation {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-self: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-raised);
}

.primary-nav-link {
  position: relative;
  min-width: 92px;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--muted-bright);
  font-size: 11px;
  font-weight: 680;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.primary-nav-link[hidden] {
  display: none;
}

.primary-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.primary-nav-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.primary-nav-link[aria-current="page"] {
  color: var(--cyan);
  background: var(--panel-solid);
  box-shadow: 0 1px 3px rgba(31, 47, 52, 0.12);
}

/* Unread messages of the chat on the "Chat" entry (chat_badge.js); "@" when someone mentions you. */
.primary-nav-badge {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--cyan-soft, rgba(0, 111, 120, 0.11));
  color: var(--cyan);
  font-size: 10px;
  font-weight: 750;
}

.primary-nav-badge[data-mention="true"] {
  background: var(--red, #b42318);
  color: #fff;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

/* Chat and map pages share this compact phone layout; page styles resolve specific overrides. */
@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 10px;
  }

  .topbar .eyebrow,
  .topbar h1 {
    display: none;
  }

  .primary-navigation {
    justify-self: stretch;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav-link {
    flex: none;
    min-width: 0;
    padding: 7px 9px;
  }
}

/* Chat page: the bar on top, the chat below it filling the rest of the page. */
.chat-app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-app > .chat-topbar {
  flex: none;
  height: 72px;
}

.chat-app > .chat-shell {
  flex: 1;
  height: auto;
  min-height: 0;
}

@media (max-width: 720px) {
  .chat-app > .chat-topbar {
    height: 52px;
  }
}
