/* Shared handbook top navigation. Keep every handbook/module header visually identical. */
.topbar,
.modnav {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0;
  border-bottom: 1px dashed var(--line);
  background: rgba(243, 238, 229, .9);
  backdrop-filter: blur(10px);
}

.topbar > .wrap {
  max-width: 1180px;
  min-height: 64px;
  display: flex;
  align-items: center;
}

.topbar .topbar-inner,
.topbar .wrap.in {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.modnav .in {
  max-width: 1240px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand,
.mn-home {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.brand .back-home,
.mn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  margin-right: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}

.brand .back-home:hover,
.mn-back:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.brand .brand-sep,
.modnav .brand-sep {
  color: var(--line);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
}

.brand-dot,
.mn-home .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  animation: none;
}

.topbar .meta,
.nav-tabs,
.mn-tabs {
  flex: 0 0 auto;
}

.nav-tabs,
.mn-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
}

.mn-t {
  width: 30px;
  height: 30px;
}

@media (max-width: 760px) {
  .topbar > .wrap,
  .topbar .topbar-inner,
  .topbar .wrap.in,
  .modnav .in {
    min-height: 64px;
    gap: 12px;
  }

  .brand,
  .mn-home {
    gap: 8px;
    font-size: 12px;
    overflow: hidden;
  }

  .brand .back-home,
  .mn-back {
    height: 38px;
    padding: 0 14px;
    margin-right: 4px;
    font-size: 12px;
  }
}
